Skip to content

Commit

Permalink
feat(distribution): add container image baked with AWS CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald authored and eysi09 committed Feb 10, 2020
1 parent 1a2f69a commit adb9ab2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,21 @@ jobs:
cd garden-service
docker build -t ${TAG} -f Dockerfile .
docker push ${TAG}
build-docker-aws:
<<: *node-config
steps:
- setup_remote_docker:
docker_layer_caching: true
- checkout
- *attach-workspace
- run:
name: Build image and push to registry
command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
TAG=gardendev/garden-aws:${CIRCLE_SHA1}
cd garden-service
docker build -t ${TAG} --build-arg TAG=${CIRCLE_SHA1} -f aws.Dockerfile .
docker push ${TAG}
build-docker-gcloud:
<<: *node-config
steps:
Expand Down Expand Up @@ -549,6 +564,10 @@ workflows:
<<: *only-internal-prs
context: docker
requires: [build]
- build-docker-aws:
<<: *only-internal-prs
context: docker
requires: [build-docker]
- build-docker-gcloud:
<<: *only-internal-prs
context: docker
Expand Down
3 changes: 2 additions & 1 deletion garden-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ RUN npm install \
/usr/lib/node_modules/npm/html/* \
/usr/lib/node_modules/npm/scripts/*

ADD bin /tmp/bin
ADD bin/garden /tmp/bin/garden
ADD bin/garden-debug /tmp/bin/garden-debug
ADD build /tmp/build

RUN node_modules/.bin/pkg --target node12-alpine-x64 . \
Expand Down
6 changes: 6 additions & 0 deletions garden-service/aws.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG TAG=latest
FROM gardendev/garden:${TAG}

RUN apk add --no-cache python py-pip \
&& pip install awscli==1.17.9 --upgrade \
&& apk del py-pip
7 changes: 7 additions & 0 deletions garden-service/bin/build-containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ args=( $@ )
version=${args[0]:-$(git rev-parse --short HEAD)}

base_tag=gardendev/garden:${version}
aws_tag=gardendev/garden-aws:${version}
gcloud_tag=gardendev/garden-gcloud:${version}
buster_tag=gardendev/garden:${version}-buster

Expand All @@ -18,6 +19,12 @@ docker build -t ${base_tag} -f Dockerfile .
echo "-> Check ${base_tag}"
docker run --rm -it ${base_tag} version

echo "-> Build ${aws_tag}"
docker build -t ${aws_tag} --build-arg TAG=${version} -f aws.Dockerfile .
echo "-> Check ${aws_tag}"
docker run --rm -it ${aws_tag} version
docker run --rm -it --entrypoint=aws ${aws_tag} --version

echo "-> Build ${gcloud_tag}"
docker build -t ${gcloud_tag} --build-arg TAG=${version} -f gcloud.Dockerfile .
echo "-> Check ${gcloud_tag}"
Expand Down
1 change: 1 addition & 0 deletions garden-service/bin/push-containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ version=${args[0]:-$(git rev-parse --short HEAD)}
echo "Pushing images"

docker push gardendev/garden:${version}
docker push gardendev/garden-aws:${version}
docker push gardendev/garden-gcloud:${version}
docker push gardendev/garden:${version}-buster

0 comments on commit adb9ab2

Please sign in to comment.