feat: Alpine based Docker image#239
Conversation
|
I am really not sure that we want to maintain extra platforms. If there is something not working with the one we already have, let's fix it. |
I'm fine with removing the old debian based image. |
|
I don't think we need |
|
I hope this is better! |
MaxymVlasov
left a comment
There was a problem hiding this comment.
Hi
Thank you for moving that to a more tiny image
But before I will test that it works as expected, please do the next things:
| @@ -0,0 +1,2 @@ | |||
| ignored: | |||
| - DL3059 | |||
There was a problem hiding this comment.
Please, move this one to .pre-commit-config.yaml
| ARG INSTALL_ALL=${INSTALL_ALL:-false} | ||
|
|
||
| # hadolint ignore=DL3018 | ||
| RUN apk add --no-cache jq curl unzip && rm -rf "/var/cache/apk/*" |
There was a problem hiding this comment.
--no-cache == rm -rf "/var/cache/apk/*"
| RUN apk add --no-cache jq curl unzip && rm -rf "/var/cache/apk/*" | |
| RUN apk add --no-cache jq curl unzip |
|
|
||
| # install build tools | ||
| # hadolint ignore=DL3013 | ||
| RUN python3 -m pip install --no-cache-dir --upgrade pip |
There was a problem hiding this comment.
You use python as a base image. Why do you think that it can include outdated pip?
I pretty sure that this step can be removed
| TERRAFORM_VERSION=$(curl -sS https://api.github.com/repos/hashicorp/terraform/releases/latest | jq -r .name | sed -r 's/v([0-9]+\.[0-9]\.+[0-9]+)/\1/g') && \ | ||
| export TERRAFORM_VERSION \ |
There was a problem hiding this comment.
| TERRAFORM_VERSION=$(curl -sS https://api.github.com/repos/hashicorp/terraform/releases/latest | jq -r .name | sed -r 's/v([0-9]+\.[0-9]\.+[0-9]+)/\1/g') && \ | |
| export TERRAFORM_VERSION \ | |
| TERRAFORM_VERSION=$(curl -sS https://api.github.com/repos/hashicorp/terraform/releases/latest | jq -r .name | sed -r 's/v([0-9]+\.[0-9]\.+[0-9]+)/\1/g') \ |
| # In one environemt it gives me 255 | ||
| #RUN F=tools_versions_info && \ | ||
| # pre-commit --version >> $F && \ | ||
| # terraform --version | head -n 1 >> $F && \ | ||
| # (if [ "$CHECKOV_VERSION" != "false" ] || [ "${INSTALL_ALL}" = "true" ]; then echo "checkov $(checkov --version)" >> $F; else echo "checkov SKIPPED" >> $F ; fi) && \ | ||
| # (if [ "$TERRAFORM_DOCS_VERSION" != "false" ] || [ "${INSTALL_ALL}" = "true" ]; then ./terraform-docs --version >> $F; else echo "terraform-docs SKIPPED" >> $F; fi) && \ | ||
| # (if [ "$TERRAGRUNT_VERSION" != "false" ] || [ "${INSTALL_ALL}" = "true" ]; then ./terragrunt --version >> $F; else echo "terragrunt SKIPPED" >> $F ; fi) && \ | ||
| # (if [ "$TERRASCAN_VERSION" != "false" ] || [ "${INSTALL_ALL}" = "true" ]; then echo "terrascan $(./terrascan version)" >> $F; else echo "terrascan SKIPPED" >> $F ; fi) && \ | ||
| # (if [ "$TFLINT_VERSION" != "false" ] || [ "${INSTALL_ALL}" = "true" ]; then ./tflint --version >> $F; else echo "tflint SKIPPED" >> $F ; fi) && \ | ||
| # (if [ "$TFSEC_VERSION" != "false" ] || [ "${INSTALL_ALL}" = "true" ]; then echo "tfsec $(./tfsec --version)" >> $F; else echo "tfsec SKIPPED" >> $F ; fi) && \ | ||
| # cat $F |
There was a problem hiding this comment.
This is needed for debugging purposes.
If you have any idea how it can be realized in a different way - please, share
Put an
xinto the box if that apply:Description of your changes
The current debian/ubuntu mixed image is just not working. I've made an alpine based one.
How has this code been tested
In gitlab ci for some reason the commented out version file part of the Dockerfile is giving me 255, but it works fine locally with the same parameters. Nevertheless, this image works, the other is not.