-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: use opentofu binary in harness terraform image #217
base: main
Are you sure you want to change the base?
Changes from 13 commits
91a9c15
7e6f699
b9d8f06
fe3b028
21c85fa
ac42531
0f2fb54
145b352
693ca99
a47a487
bfd2b35
25c32de
113a341
8e4f1ba
14bd633
baeec9c
9702e2a
8ed5f4c
0cb44b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG TOFU_IMAGE_TAG=1.7.1 | ||
|
||
ARG TOFU_IMAGE=ghcr.io/opentofu/opentofu:$TOFU_IMAGE_TAG | ||
|
||
ARG HARNESS_BASE_IMAGE_TAG=sha-1eca71e | ||
ARG HARNESS_BASE_IMAGE_REPO=harness-base | ||
ARG HARNESS_BASE_IMAGE=$HARNESS_BASE_IMAGE_REPO:$HARNESS_BASE_IMAGE_TAG | ||
|
||
FROM $TOFU_IMAGE AS tofu | ||
Check warning Code scanning / Trivy ':latest' tag used Medium
Artifact: dockerfiles/harness/opentofu.Dockerfile
Type: dockerfile Vulnerability DS001 Severity: MEDIUM Message: Specify a tag in the 'FROM' statement for image '1.7.1' Link: DS001 |
||
FROM $HARNESS_BASE_IMAGE AS final | ||
Check warning Code scanning / Trivy ':latest' tag used Medium
Artifact: dockerfiles/harness/opentofu.Dockerfile
Type: dockerfile Vulnerability DS001 Severity: MEDIUM Message: Specify a tag in the 'FROM' statement for image 'harness-base' Link: DS001 Check warning Code scanning / Trivy ':latest' tag used Medium
Artifact: dockerfiles/harness/opentofu.Dockerfile
Type: dockerfile Vulnerability DS001 Severity: MEDIUM Message: Specify a tag in the 'FROM' statement for image 'sha-1eca71e' Link: DS001
|
||
|
||
COPY --from=tofu /usr/local/bin/tofu /bin/terraform | ||
|
||
USER root | ||
ENV TF_CLI_CONFIG_FILE=/usr/local/etc/plrl.tfrc | ||
COPY dockerfiles/harness/plrl.tfrc $TF_CLI_CONFIG_FILE | ||
RUN chown 65532:65532 $TF_CLI_CONFIG_FILE | ||
|
||
# Switch to the non-root user | ||
USER 65532:65532 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
provider_installation { | ||
direct { | ||
include = [ | ||
"registry.terraform.io/*" | ||
] | ||
|
||
exclude = [ | ||
"registry.opentofu.org/*" | ||
] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these versions actually aligned? Looks like the tofu version is always
1.6.2
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, according to OpenTofu Migration Docs
But with a caveat: