Merge pull request #1407 from drwetter/dockerIDcheck

Handle problem when pulling container fails
This commit is contained in:
Dirk Wetter 2019-12-09 11:04:17 +01:00 committed by GitHub
commit b38e433ec4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,8 @@ image=${1:-"debian:buster"}
docker pull "$image" docker pull "$image"
ID=$(docker run -d -ti $image) ID=$(docker run -d -ti $image)
[[ "$ID" ]] && echo "container couldn't be retrieved" >&2 && exit 1
docker exec -ti $ID apt-get update docker exec -ti $ID apt-get update
docker exec -ti $ID apt-get install -y ssl-cert dialog docker exec -ti $ID apt-get install -y ssl-cert dialog
docker exec -ti $ID apt-get install -y nginx-common nginx-light docker exec -ti $ID apt-get install -y nginx-common nginx-light

View File

@ -6,6 +6,8 @@ ID=$(docker run -d -ti $image)
echo $ID echo $ID
[[ "$ID" ]] && echo "container couldn't be retrieved" >&2 && exit 1
docker exec -ti $ID nginx -V docker exec -ti $ID nginx -V
docker exec -ti $ID mkdir /etc/nginx/ssl docker exec -ti $ID mkdir /etc/nginx/ssl
HN=$(docker exec -ti $ID hostname| tr -d '\n' | tr -d '\r') HN=$(docker exec -ti $ID hostname| tr -d '\n' | tr -d '\r')