-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Terragrunt runner image (#51)
* Create docker image for terragrunt runner * Wrap up terragunt container
- Loading branch information
1 parent
50249b2
commit b7d4904
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Publish Terragrunt Image | ||
|
||
on: | ||
push: | ||
paths: | ||
- "terragrunt/**" | ||
- ".github/workflows/publish-terragrunt-image.yml" | ||
branches: | ||
- master | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository_owner }}/terragrunt | ||
|
||
jobs: | ||
build-latest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU #emulation support with QEMU to be able to build against more platforms. | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push the container to GitHub Container Registry using the latest tag | ||
uses: docker/build-push-action@v5.3.0 | ||
with: | ||
context: . | ||
file: terragrunt/Dockerfile | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
push: true | ||
provenance: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Versions | ||
ARG ALPINE_VERSION=3.20 | ||
ARG TOFU_VERSION=1.6.2 | ||
ARG SOPS_VERSION=v3.8.1 | ||
|
||
FROM ghcr.io/getsops/sops:${SOPS_VERSION}-alpine as sops | ||
FROM ghcr.io/opentofu/opentofu:${TOFU_VERSION} as tofu | ||
|
||
FROM alpine:${ALPINE_VERSION} as build | ||
|
||
ARG TARGETARCH=arm64 | ||
ARG TERRAGRUNT_VERSION=v0.58.6 | ||
ARG KUBECTL_VERSION=v1.30.0 | ||
ARG HELM_VERSION=v3.15.1 | ||
|
||
RUN apk update && \ | ||
apk add curl ca-certificates | ||
|
||
RUN curl -L \ | ||
https://github.com/gruntwork-io/terragrunt/releases/download/${TERRAGRUNT_VERSION}/terragrunt_linux_amd64 -o terragrunt && \ | ||
chmod +x terragrunt && \ | ||
mv terragrunt /usr/local/bin/ | ||
RUN terragrunt --version | ||
|
||
RUN curl -L -o kubectl https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl && \ | ||
curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl.sha256" && \ | ||
echo "$(cat kubectl.sha256) kubectl" | sha256sum -c && \ | ||
chmod +x kubectl && \ | ||
mv kubectl /usr/local/bin/kubectl | ||
|
||
RUN curl -LO https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz && \ | ||
curl -LO https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz.sha256sum && \ | ||
sha256sum -c helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz.sha256sum && \ | ||
tar -xvzf helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz && \ | ||
chmod +x linux-${TARGETARCH}/helm && \ | ||
mv linux-${TARGETARCH}/helm /usr/local/bin/helm | ||
|
||
FROM alpine:${ALPINE_VERSION} | ||
|
||
RUN apk update && \ | ||
apk add aws-cli jq yq-go git | ||
RUN aws --version | ||
|
||
COPY --from=sops /usr/local/bin/sops /usr/local/bin/sops | ||
COPY --from=tofu /usr/local/bin/tofu /usr/local/bin/tofu | ||
COPY --from=build /usr/local/bin/terragrunt /usr/local/bin/terragrunt | ||
COPY --from=build /usr/local/bin/kubectl /usr/local/bin/kubectl | ||
COPY --from=build /usr/local/bin/helm /usr/local/bin/helm |