Skip to content

Commit a0036c7

Browse files
committed
Enable changing the image tag used with Docker Compose
Add the ability to change the image tag used for the Lambda image in the Docker Compose configuration. This is done using the LAMBDA_TAG environment variable with a fallback to the default value of latest.
1 parent a62a300 commit a0036c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ version: '3.2'
44
services:
55
build_deployment_package:
66
build: .
7-
image: "cisagov/example_lambda"
7+
# This uses the value of the LAMBDA_TAG environment variable from
8+
# the invoking environment but falls back to a default value.
9+
image: cisagov/example_lambda:${LAMBDA_TAG:-latest}
810
entrypoint: /opt/build_artifact.sh
911
environment:
1012
# This uses the value of the BUILD_FILE_NAME environment variable
@@ -15,6 +17,8 @@ services:
1517
- .:/var/task/output
1618
run_lambda_locally:
1719
build: .
18-
image: "cisagov/example_lambda"
20+
# This uses the value of the LAMBDA_TAG environment variable from
21+
# the invoking environment but falls back to a default value.
22+
image: cisagov/example_lambda:${LAMBDA_TAG:-latest}
1923
ports:
2024
- "9000:8080"

0 commit comments

Comments
 (0)