Skip to content

Commit

Permalink
fix: replace asdf installation method for aws cli with apk (#26)
Browse files Browse the repository at this point in the history
* chore: repair aws cli

* chore: replace pip with apk

* test

* test

* test

* test

* test

* chore: update docs

* chore: remove pinned version

* chore: move awscli to layer with different apk packages

* chore: bump base image

---------

Co-authored-by: Piotr Sierkin <piotr.sierkin@getindata.com>
  • Loading branch information
Santhin and Piotr Sierkin authored Jul 4, 2023
1 parent 9d63fe5 commit 95e9708
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ That custom `atlantis` docker image was created in order to install few helpful
- `glab` (via asdf) - GitLab CLI client
- `az-cli` (via pip) - Azure CLI
- `Infracost` - cloud cost estimates
- `aws-cli` (via asdf) - AWS CLI
- `aws-cli` (via apk) - AWS CLI

Files found in the repo:
- `Dockerfile` is based on an official atlantis docker file (<https://github.com/runatlantis/atlantis/blob/v0.17.3/Dockerfile>) with some additional tweaks (asdf installation and configuration)
Expand Down
12 changes: 4 additions & 8 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
ARG ATLANTIS_BASE_VERSION=2023.03.01-alpine
ARG ATLANTIS_BASE_VERSION=2023.03.30
# The runatlantis/atlantis-base is created by docker-base/Dockerfile.
FROM ghcr.io/runatlantis/atlantis-base:${ATLANTIS_BASE_VERSION} AS base

Expand All @@ -20,12 +20,11 @@ ARG CHECKOV_VERSION=2.1.244
ARG INFRACOST_VERSION=v0.10.18
ARG TFLINT_VERSION=0.45.0
ARG TERRAFORM_DOCS_VERSION=0.16.0
ARG AWS_CLI_VERSION=2.12.6

RUN set -ex && \
apk update && \
apk add bash py3-pip curl && \
apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python3-dev cargo make curl unzip
apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python3-dev cargo make curl unzip aws-cli

###
### Install Checkov
Expand Down Expand Up @@ -80,8 +79,7 @@ RUN gosu atlantis bash -l -c " \
asdf plugin-add gojq && \
asdf plugin-add tflint && \
asdf plugin-add terraform-docs && \
asdf plugin-add yq && \
asdf plugin add awscli"
asdf plugin-add yq"
# Install default versions and define them globally
RUN gosu atlantis bash -l -c " \
cd /home/atlantis/ && \
Expand All @@ -95,7 +93,6 @@ RUN gosu atlantis bash -l -c " \
asdf install tflint ${TFLINT_VERSION} && \
asdf install terraform-docs ${TERRAFORM_DOCS_VERSION} && \
asdf install yq ${YQ_VERSION} && \
asdf install awscli ${AWS_CLI_VERSION} && \
asdf global kubectl ${K8S_VERSION} && \
asdf global helm ${HELM_VERSION} && \
asdf global terraform ${TF_VERSION} && \
Expand All @@ -105,8 +102,7 @@ RUN gosu atlantis bash -l -c " \
asdf global gojq ${GOJQ_VERSION} && \
asdf global tflint ${TFLINT_VERSION} && \
asdf global terraform-docs ${TERRAFORM_DOCS_VERSION} && \
asdf global yq ${YQ_VERSION} && \
asdf global awscli ${AWS_CLI_VERSION}"
asdf global yq ${YQ_VERSION}"

# Additional cleanup
RUN rm -rf /tmp/*
Expand Down

0 comments on commit 95e9708

Please sign in to comment.