2020-03-27 13:20:10 +03:00
|
|
|
#!/usr/bin/env sh
|
2019-01-08 22:59:29 +03:00
|
|
|
|
2022-03-04 12:30:39 +03:00
|
|
|
# Copyright 2018-2022 Docker Inc.
|
2020-02-17 17:27:04 +03:00
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2019-01-08 22:59:29 +03:00
|
|
|
IMAGE=$1
|
|
|
|
|
|
|
|
run() {
|
2020-03-26 17:09:28 +03:00
|
|
|
docker run --rm -i "${IMAGE}" sh -c "$*" > /dev/null 2> /dev/null
|
2019-01-08 22:59:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if run rpm --version; then
|
2020-03-26 17:09:28 +03:00
|
|
|
echo "rpm"
|
2019-01-08 22:59:29 +03:00
|
|
|
elif run dpkg --version; then
|
2020-03-26 17:09:28 +03:00
|
|
|
echo "deb"
|
2019-01-08 22:59:29 +03:00
|
|
|
else
|
2020-03-26 17:09:28 +03:00
|
|
|
exit 1
|
2019-01-08 22:59:29 +03:00
|
|
|
fi
|