1- FROM cloudposse/geodesic:0.132.1
1+ ARG CLI_NAME=atmos
2+
3+ FROM cloudposse/geodesic:0.137.0 as cli
4+
5+ RUN apk add -u go variant2@cloudposse
6+
7+ # Configure Go
8+ ENV GOROOT /usr/lib/go
9+ ENV GOPATH /go
10+ ENV PATH /go/bin:$PATH
11+
12+ # Build a minimal variant binary in order to download all the required libraries and save them in a Docker layer cache
13+ COPY cli/build-cache /tmp
14+ WORKDIR /tmp/build-cache
15+ RUN variant2 export binary $PWD variant-echo
16+
17+ # Build the CLI
18+ WORKDIR /usr/cli
19+ COPY cli/ .
20+ ARG CGO_ENABLED=1
21+ ARG CLI_NAME
22+ RUN variant2 export binary $PWD $CLI_NAME
23+
24+ # Verify the CLI
25+ RUN ./"$CLI_NAME" help
26+
27+
28+ FROM cloudposse/geodesic:0.137.0
229
330# Geodesic message of the Day
431ENV MOTD_URL="https://geodesic.sh/motd"
@@ -11,39 +38,47 @@ ENV DIRENV_ENABLED=false
1138
1239ENV DOCKER_IMAGE="cloudposse/reference-architectures"
1340ENV DOCKER_TAG="latest"
14- ENV NAMESPACE="eg"
1541
1642# Geodesic banner message
17- ENV BANNER="sweet ops "
43+ ENV BANNER="SweetOps "
1844
19- # Pin kubectl to version 1.15
20- RUN apk add kubectl-1.15@cloudposse
45+ # Enable advanced AWS assume role chaining for tools using AWS SDK
46+ # https://docs.aws.amazon.com/sdk-for-go/api/aws/session/
47+ ENV AWS_SDK_LOAD_CONFIG=1
48+ ENV AWS_DEFAULT_REGION=us-east-2
2149
22- # Install terraform
23- RUN apk add terraform @cloudposse
50+ # Pin kubectl to version 1.17 (must be within 1 minor version of cluster version)
51+ RUN apk add kubectl-1.17 @cloudposse
2452
25- # Install helmfile
26- RUN apk add helmfile@cloudposse
53+ # Install terraform
54+ # Install the latest 0.12 and 0.13 versions of terraform
55+ RUN apk add -u terraform-0.12@cloudposse terraform-0.13@cloudposse~=0.13.3
56+ # Set Terraform 0.12.x as the default `terraform`. You can still use
57+ # `terraform-0.12` or `terraform-0.13` to be explicit when needed.
58+ RUN update-alternatives --set terraform /usr/share/terraform/0.12/bin/terraform
2759
28- # Install saml2aws
2960# https://github.com/Versent/saml2aws#linux
3061RUN apk add saml2aws@cloudposse
3162
3263# Install assume-role
3364RUN apk add assume-role@cloudposse
3465
35- # Install variant2 overwriting variant
36- RUN apk add variant2@cloudposse
37-
3866# Install the "docker" command to interact with the host's Docker daemon
3967RUN apk add -u docker-cli
4068
41- # Limit Makefile searches set up by Geodesic
42- # Allow a single Makefile to serve all child directories
43- ENV MAKE_INCLUDES="Makefile.settings ../Makefile.parent Makefile"
69+ # Install vendir
70+ RUN apk add vendir@cloudposse
4471
45- COPY rootfs/ /
72+ # Install variant2
73+ RUN apk add variant2@cloudposse
74+ RUN update-alternatives --set variant /usr/share/variant/2/bin/variant
4675
47- COPY projects/ /projects/
76+ # Install CLI
77+ ARG CLI_NAME
78+ COPY --from=cli /usr/cli/$CLI_NAME /usr/local/bin
79+
80+ COPY rootfs/ /
81+ COPY stacks/ /stacks/
82+ COPY vendor/ /vendor/
4883
49- WORKDIR /projects/
84+ WORKDIR /
0 commit comments