tofuutils / tenv

OpenTofu / Terraform / Terragrunt and Atmos version manager
https://tofuutils.github.io/tenv/
Apache License 2.0
726 stars 38 forks source link

Publish linux arm64 image to dockerhub #217

Closed eepmoi closed 3 months ago

eepmoi commented 3 months ago

Is your feature request related to a problem? Please describe. Hi folks - I want to use tenv in docker for my CI pipeline which runs on linux arm64. It would be fantastic if you could publish an arm64 version to dockerhub, currently only amd. https://hub.docker.com/r/tofuutils/tenv/tags?page=&page_size=&ordering=&name=

This saves me having to manually build an arm64 docker image for CI.

Describe the solution you'd like Publish a linux arm64 image to dockerhub.

Describe alternatives you've considered Crafting my own dockfile to install the linux arm64 binary.

Additional context image

Thanks for your time.

kvendingoldo commented 3 months ago

@eepmoi Hi! Thank you for the issue. Will add this support soon

eepmoi commented 3 months ago

Great thanks @kvendingoldo!

If it helps others, here's my Dockerfile.

FROM public.ecr.aws/docker/library/alpine:3.20

# renovate: datasource=github-releases depName=tofuutils/tenv
ENV TENV_VERSION=2.6.1

ADD https://github.com/tofuutils/tenv/releases/download/v${TENV_VERSION}/tenv_v${TENV_VERSION}_Linux_arm64.tar.gz /tmp
RUN tar -xvzf /tmp/tenv_v${TENV_VERSION}_Linux_arm64.tar.gz -C /usr/bin

WORKDIR /workdir

COPY .terraform-version .
RUN TF_VERSION=$(cat .terraform-version) && \
  echo "Using Terraform version $TF_VERSION" && \
  tenv tf use $TF_VERSION --install

CMD ["terraform"]

With renovate config snippet for those who use it:

  "customManagers": [
    {
      "customType": "regex",
      "description": "Update _VERSION variables in Dockerfiles",
      "fileMatch": ["(^|/|\\.)Dockerfile$", "(^|/)Dockerfile\\.[^/]*$"],
      "matchStrings": [
        "# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s(?:ENV|ARG) .*?_VERSION=(?<currentValue>.*)\\s"
      ]
    }
  ]
kvendingoldo commented 3 months ago

@eepmoi looks like it's done :)

Screenshot 2024-07-26 at 04 07 07