diff options
-rwxr-xr-x | build/create_repo.sh | 6 | ||||
-rwxr-xr-x | build/docker-entrypoint.sh | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/build/create_repo.sh b/build/create_repo.sh index ec9b239b..e70d69b2 100755 --- a/build/create_repo.sh +++ b/build/create_repo.sh @@ -155,14 +155,12 @@ then mounted_lists+=(-v ${array_list}:${container_list_volume}${array_list##*/}) done - docker run -d \ - --name $container_name \ + docker run --name $container_name \ -v ${volume_offline_directory}:${container_offline_volume} \ -v ${volume_repo_directory}:${container_repo_volume} \ "${mounted_lists[@]}" \ --rm \ --entrypoint="${container_offline_volume}docker-entrypoint.sh" \ - -it ${docker_image} \ + ${docker_image} \ "${param_array[@]}" - docker logs $(docker ps --filter name="^${container_name}$" --format '{{.ID}}' -a) -f fi diff --git a/build/docker-entrypoint.sh b/build/docker-entrypoint.sh index 965037e0..7d5f5b2d 100755 --- a/build/docker-entrypoint.sh +++ b/build/docker-entrypoint.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -eo pipefail + # Set distribution family distro_type=$(cat /etc/*-release | grep -w "ID" | awk -F'=' '{ print $2 }' | tr -d '"') case "$distro_type" in @@ -45,7 +47,6 @@ EOF } # Getting input parameters -POSITIONAL=() if [[ $# -eq 0 ]] ; then help # show help exit 0 @@ -107,6 +108,9 @@ then PCKG_LIST_DIR="/tmp/additional-lists/" fi +# Clean target repo dir for idempotency +rm -rf ${OFFLINE_REPO_DIR}/* + case "$distro_type" in ubuntu) # Change current working dir |