Skip to content

Commit 723b9fb

Browse files
committed
fix: add container-name to containerized binary scripts
1 parent 498d497 commit 723b9fb

File tree

8 files changed

+8
-0
lines changed

8 files changed

+8
-0
lines changed

bin/awscli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ main() {
1717
OPTS+=(-v ~/.aws:/root/.aws)
1818
OPTS+=(-v "$(pwd):/aws")
1919
[[ -n "${AWS_PROFILE:-}" ]] && OPTS+=(-e "AWS_PROFILE=$AWS_PROFILE")
20+
OPTS+=(--name "${PWD##*/}-awscli-${AWSCLI_VERSION}")
2021
docker run "${OPTS[@]}" "${AWSCLI_IMAGE}:${AWSCLI_VERSION}" "$@"
2122
fi
2223
}

bin/dive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ main() {
2121
[[ "$(whoami)" == "runner" ]] && OPTS+=(-e "CI=true")
2222
# https://github.com/wagoodman/dive#ui-configuration
2323
[[ -r "$HOME/.dive.yaml" ]] && OPTS+=(-v "$HOME/.dive.yaml":"$HOME/.dive.yaml")
24+
OPTS+=(--name "${PWD##*/}-dive-${DIVE_VERSION}")
2425
docker run "${OPTS[@]}" "${DIVE_IMAGE}:${DIVE_VERSION}" "$@"
2526
}
2627

bin/iac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ main() {
5757
[[ -n "${AWS_ACCESS_KEY_ID:-}" ]] && OPTS+=(-e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}")
5858
[[ -n "${AWS_SECRET_ACCESS_KEY:-}" ]] && OPTS+=(-e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}")
5959
[[ -n "${AWS_SESSION_TOKEN:-}" ]] && OPTS+=(-e "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}")
60+
OPTS+=(--name "${PWD##*/}-iac-${_IMAGE_TAG}")
6061
# Uncomment to debug the final command.
6162
# echo "docker run ${OPTS[*]} devopsinfra/docker-terragrunt:${_IMAGE_TAG} ${*}"
6263
docker run "${OPTS[@]}" "devopsinfra/docker-terragrunt:${_IMAGE_TAG}" "$@"

bin/imagemagick

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ main() {
1313
# OPTS+=(-q)
1414
# [[ -t 0 ]] && OPTS+=(-it) # terminal
1515
OPTS+=(-v "$(pwd):/imgs")
16+
OPTS+=(--name "${PWD##*/}-imagemagick-${IMAGEMAGICK_VERSION}")
1617
docker run "${OPTS[@]}" "${IMAGEMAGICK_IMAGE}:${IMAGEMAGICK_VERSION}" "$@"
1718
}
1819

bin/megalinter

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ main() {
9393
OPTS+=(-e "TRIVY_SKIP_DB_UPDATE=true")
9494
OPTS+=(-e "TRIVY_SKIP_JAVA_DB_UPDATE=true")
9595
OPTS+=(-e "TRIVY_SKIP_CHECK_UPDATE=true")
96+
OPTS+=(--name "${PWD##*/}-megalinter-${MEGALINTER_VERSION}")
9697
docker run "${OPTS[@]}" "${MEGALINTER_IMAGE}:${MEGALINTER_VERSION}" "$@"
9798
fi
9899
}

bin/opentofu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ main() {
1616
[[ -t 0 ]] && OPTS+=(-it) # terminal
1717
OPTS+=(-w /srv/workspace)
1818
OPTS+=(--mount "type=bind,source=$(pwd),target=/srv/workspace")
19+
OPTS+=(--name "${PWD##*/}-opentofu-${OPENTOFU_VERSION}")
1920
docker run "${OPTS[@]}" "${OPENTOFU_IMAGE}:${OPENTOFU_VERSION}" "$@"
2021
fi
2122
}

bin/packer

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ main() {
1616
[[ -t 0 ]] && OPTS+=(-it) # terminal
1717
OPTS+=(-v "$(pwd):/workspace")
1818
OPTS+=(-w /workspace)
19+
OPTS+=(--name "${PWD##*/}-packer-${PACKER_VERSION}")
1920
docker run "${OPTS[@]}" "${PACKER_IMAGE}:${PACKER_VERSION}" "$@"
2021
fi
2122
}

bin/superlinter

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ main() {
1818
OPTS+=(-e RUN_LOCAL=true)
1919
[[ -e "$(pwd)/.github/super-linter.env" ]] &&
2020
OPTS+=(--env-file "$(pwd)/.github/super-linter.env")
21+
OPTS+=(--name "${PWD##*/}-superlinter-${SUPERLINTER_VERSION}")
2122
docker run "${OPTS[@]}" "${SUPERLINTER_IMAGE}:${SUPERLINTER_VERSION}" "$@"
2223
fi
2324
}

0 commit comments

Comments
 (0)