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

docker_additional_options is not passed to container when building with poetry #427

Closed
1 task done
FurqanHabibi opened this issue Feb 27, 2023 · 6 comments · Fixed by #443
Closed
1 task done

docker_additional_options is not passed to container when building with poetry #427

FurqanHabibi opened this issue Feb 27, 2023 · 6 comments · Fixed by #443

Comments

@FurqanHabibi
Copy link

FurqanHabibi commented Feb 27, 2023

Description

We are trying to pass the following environment variable to the docker container via docker_additional_options:

docker_additional_options = ["-e", "PIP_PLATFORM=manylinux2014_aarch64"]

but as can be seen in the following output, said options is not being passed to the docker run command:

module.le_auto_stack.module.lambda_issue_layer.null_resource.archive[0] (local-exec): > docker run --rm -w /var/task -v /tmp/terraform-aws-lambda-fyvlzv2k:/var/task:z -v /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:z --entrypoint '' 1d556381b475 /bin/sh -c 'poetry config --no-interaction virtualenvs.create true && poetry config --no-interaction virtualenvs.in-project true && poetry export --format requirements.txt --output requirements.txt --with-credentials && python3.9 -m pip install --no-compile --no-deps --prefix= --target=. --requirement=requirements.txt && chown -R 1001:123 .'
  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version: 4.10.1
  • Terraform version:v1.3.7
  • Provider version(s):
+ provider registry.terraform.io/hashicorp/aws v4.56.0
+ provider registry.terraform.io/hashicorp/external v2.2.3
+ provider registry.terraform.io/hashicorp/local v2.3.0
+ provider registry.terraform.io/hashicorp/null v3.2.1

Reproduction Code

Modify the build-package example's package_dir_poetry module below

module "package_dir_poetry" {

by adding

docker_additional_options = ["-e", "PIP_PLATFORM=manylinux2014_aarch64"]

Steps to reproduce the behavior:

Expected behavior

docker_additional_options should be passed to the docker run command.

Actual behavior

docker_additional_options is not passed to the docker run command.

Terminal Output Screenshot(s)

image

Additional context

The culprit is likely this line

docker_run_command(

docker object is not passed to docker_run_command.

@github-actions
Copy link

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Mar 30, 2023
@pdecat
Copy link
Contributor

pdecat commented Mar 30, 2023

Hi @FurqanHabibi,

you mention it is not working with poetry, does that mean it works with pip?

@pdecat
Copy link
Contributor

pdecat commented Mar 30, 2023

Ok, understood what you meant when pointing to

docker_run_command(

Working on a fix...

@pdecat
Copy link
Contributor

pdecat commented Mar 30, 2023

Submitted #443

@antonbabenko
Copy link
Member

This issue has been resolved in version 4.13.0 🎉

@github-actions
Copy link

github-actions bot commented May 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants