Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 6ce383d

Browse files
authored
Merge pull request #13 from derekmurawsky/master
Add environment var support for image version
2 parents 155be4b + f1302b0 commit 6ce383d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
125125

126126
## Versions
127127

128+
* **31.07.20:** - Add support for global env var `DOCKER_COMPOSE_IMAGE_TAG` in the `run.sh` script.
128129
* **06.07.20:** - Publish docker-compose and docker-cli binaries in Github releases.
129130
* **01.07.20:** - Release alpine based images at `alpine` tag.
130131
* **04.06.20:** - Bump docker-cli to 19.03.8, auto-detect python3 version.

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ full_custom_readme: |
131131
132132
## Versions
133133
134+
* **31.07.20:** - Add support for global env var `DOCKER_COMPOSE_IMAGE_TAG` in the `run.sh` script.
134135
* **06.07.20:** - Publish docker-compose and docker-cli binaries in Github releases.
135136
* **01.07.20:** - Release alpine based images at `alpine` tag.
136137
* **04.06.20:** - Bump docker-cli to 19.03.8, auto-detect python3 version.

run.sh

100644100755
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
# You can add additional volumes (or any docker run options) using
1414
# the $COMPOSE_OPTIONS environment variable.
1515
#
16+
# You can set a specific image tag from Docker Hub, such as "1.26.2-ls9", or "alpine"
17+
# using the $DOCKER_COMPOSE_IMAGE_TAG environment variable (defaults to "latest")
18+
#
1619

1720

1821
set -e
1922

20-
VERSION="latest" # can be set to a specific version tag from docker hub, such as "1.25.5", or "alpine"
21-
IMAGE="linuxserver/docker-compose:$VERSION"
22-
23+
# set image tag to latest if not globally set
24+
DOCKER_COMPOSE_IMAGE_TAG="${DOCKER_COMPOSE_IMAGE_TAG:-latest}"
25+
IMAGE="linuxserver/docker-compose:$DOCKER_COMPOSE_IMAGE_TAG"
2326

2427
# Setup options for connecting to docker host
2528
if [ -z "$DOCKER_HOST" ]; then
@@ -68,4 +71,4 @@ if docker info --format '{{json .SecurityOptions}}' 2>/dev/null | grep -q 'name=
6871
fi
6972

7073
# shellcheck disable=SC2086
71-
exec docker run --rm $DOCKER_RUN_OPTIONS $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w "$(pwd)" $IMAGE "$@"
74+
exec docker run --rm $DOCKER_RUN_OPTIONS $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w "$(pwd)" $IMAGE "$@"

0 commit comments

Comments
 (0)