Skip to content
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

fix: Docker terraform/tofu binaries not copied to final Docker image #4458

Closed
wants to merge 1 commit into from

Conversation

jippi
Copy link
Contributor

@jippi jippi commented Apr 19, 2024

what

I pulled in main to my internal testing site, and the container image failed to start with this error.

Error: initializing server: initializing terraform: terraform not found in $PATH. Set --default-tf-version or download terraform from https://developer.hashicorp.com/terraform/downloads

When I inspected /usr/local/bin in the container, I noticed none of the binaries were present.

$ find /usr/local/bin
/usr/local/bin
/usr/local/bin/docker-entrypoint.sh
/usr/local/bin/conftest
/usr/local/bin/atlantis

why

It looks like the #4341 refactor did not account for the new paths to be copied into the container.

This change rectifies this - /usr/local/bin now looks like this

$ find /usr/local/bin/
/usr/local/bin/
/usr/local/bin/docker-entrypoint.sh
/usr/local/bin/conftest
/usr/local/bin/tofu
/usr/local/bin/terraform
/usr/local/bin/opentofu
/usr/local/bin/opentofu/1.6.2
/usr/local/bin/opentofu/1.6.2/CHANGELOG.md
/usr/local/bin/opentofu/1.6.2/tofu
/usr/local/bin/opentofu/1.6.2/LICENSE
/usr/local/bin/opentofu/1.6.2/README.md
/usr/local/bin/tf
/usr/local/bin/tf/1.5.7
/usr/local/bin/tf/1.5.7/terraform
/usr/local/bin/tf/1.8.0
/usr/local/bin/tf/1.8.0/terraform
/usr/local/bin/tf/1.6.6
/usr/local/bin/tf/1.6.6/terraform
/usr/local/bin/tf/1.7.5
/usr/local/bin/tf/1.7.5/terraform
/usr/local/bin/atlantis

tests

  • docker run --rm -it ghcr.io/runatlantis/atlantis:$(TAG) ls /usr/local/bin should return the files
  • docker run --rm -it ghcr.io/runatlantis/atlantis:$(TAG) tofu should work
  • docker run --rm -it ghcr.io/runatlantis/atlantis:$(TAG) terraform should work

container final container image
@jippi jippi requested review from a team as code owners April 19, 2024 11:53
@jippi jippi requested review from GenPage, lukemassa and nitrocode and removed request for a team April 19, 2024 11:53
@github-actions github-actions bot added the build Relating to how we build Atlantis label Apr 19, 2024
@nitrocode
Copy link
Member

Thanks for the contribution. Someone found the issue and proposed another solution already.

Related PR #4439

@jippi
Copy link
Contributor Author

jippi commented Apr 19, 2024

Cool! I missed the PR while looking for existing solutions - happy as long as its fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Relating to how we build Atlantis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants