-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18241b6
commit 30e187a
Showing
4 changed files
with
65 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,45 @@ | ||
FROM docker.io/library/alpine:3.21 AS opentofu | ||
|
||
ARG VERSION | ||
ARG TARGETARCH | ||
ARG TARGETPLATFORM | ||
ARG TARGETOS | ||
|
||
LABEL dev.joryirving.image.target_platform=$TARGETPLATFORM | ||
LABEL dev.joryirving.image.target_architecture=$TARGETARCH | ||
LABEL dev.joryirving.image.target_os=$TARGETOS | ||
LABEL org.opencontainers.image.source="https://github.com/opentofu/opentofu" | ||
|
||
RUN \ | ||
apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
&& \ | ||
case "${TARGETPLATFORM}" in \ | ||
'linux/amd64') \ | ||
export ARCH='amd64'; \ | ||
;; \ | ||
'linux/arm64') \ | ||
export ARCH='arm64'; \ | ||
;; \ | ||
esac \ | ||
&& curl -fsSL -o /tmp/tofu_${VERSION}_linux_${ARCH}.tar.gz "https://github.com/opentofu/opentofu/releases/download/v${VERSION}/tofu_${VERSION}_linux_${ARCH}.tar.gz" \ | ||
&& tar -xzvf /tmp/tofu_${VERSION}_linux_${ARCH}.tar.gz -C /tmp | ||
|
||
FROM ghcr.io/flux-iac/tofu-controller:v0.16.0-rc.5 AS runner | ||
|
||
ARG VERSION | ||
ARG TARGETARCH | ||
ARG TARGETPLATFORM | ||
ARG TARGETOS | ||
|
||
LABEL dev.joryirving.image.target_platform=$TARGETPLATFORM | ||
LABEL dev.joryirving.image.target_architecture=$TARGETARCH | ||
LABEL dev.joryirving.image.target_os=$TARGETOS | ||
LABEL org.opencontainers.image.source="https://github.com/opentofu/opentofu" | ||
|
||
USER root | ||
|
||
COPY --from=opentofu --chown=65532:65532 /tmp/tofu /usr/local/bin/tofu | ||
|
||
USER 65532:65532 |
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,5 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/goss-org/goss/master/docs/schema.yaml | ||
file: | ||
/usr/local/bin/tofu: | ||
exists: true |
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,5 @@ | ||
#!/usr/bin/env bash | ||
version=$(curl -sX GET "https://api.github.com/repos/opentofu/opentofu/releases/latest" | jq --raw-output '.tag_name') | ||
version="${version#*v}" | ||
version="${version#*release-}" | ||
printf "%s" "${version}" |
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,10 @@ | ||
--- | ||
app: opentofu-runner | ||
semver: true | ||
channels: | ||
- name: stable | ||
platforms: ["linux/amd64", "linux/arm64"] | ||
stable: true | ||
tests: | ||
enabled: false | ||
type: cli |