-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Command not found Error in Docker Pre-Commit Hook for OpenTofu #5
Comments
i found a quick fix for this issue, installing opentofu in the container:
|
we'll try to fix it permanently |
@kvendingoldo great i think the problem ist this code here: # https://github.com/tofuutils/pre-commit-opentofu/blob/main/Dockerfile#L24C1-L28C26
RUN curl -LO https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_${TARGETOS}_${TARGETARCH}.zip \
&& curl -LO https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_SHA256SUMS \
&& [ $(sha256sum "tofu_${TOFU_VERSION}_${TARGETOS}_${TARGETARCH}.zip" | cut -f 1 -d ' ') = "$(grep "tofu_${TOFU_VERSION}_${TARGETOS}_${TARGETARCH}.zip" tofu_*_SHA256SUMS | cut -f 1 -d ' ')" ] \
&& unzip tofu_${TOFU_VERSION}_${TARGETOS}_${TARGETARCH}.zip \
&& mv tofu /usr/bin/tofu The OpenTofu binary seems not to have been extracted and what was moved to /usr/bin were the ZIPs. I plan to create a PR by the end of the week, if you make it before then, perfect. |
@dev-ago sounds great! Will wait for the pr! |
@kvendingoldo this is the fix for the dockerfile:
|
I cant create a PR. |
Is it the issue with permissions or ..? |
Describe the bug
I am encountering an issue while using the pre-commit hook for OpenTofu in Docker. The hook consistently fails with the following error message.
The same pre-commit config works fine on Mac OS X directly
Repository: pre-commit-opentofu
Docker Image Tags Tested: latest, nightly
Docker Image: tofuutils/pre-commit-opentofu
How can we reproduce it?
Observed Behavior:
The hook fails with the tofu: command not found error.
Expected Behavior:
The hook should run the tofu fmt command successfully.
Environment information
Docker: tofuutils/pre-commit-opentofu:nightly
Docker: tofuutils/pre-commit-opentofu:latest
Docker image tag/git commit:
latest & nightly
.pre-commit-config.yaml
:The text was updated successfully, but these errors were encountered: