Skip to content

[build] Add DOCKER_USER_ENV option #16904

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ ifneq ($(SIGNING_CERT),)
endif
endif

# Allow user-defined environmental variables to be imported into the build containers
ifneq ($(DOCKER_USER_ENV),)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using SONIC_BUILDER_EXTRA_CMDLINE to add the additional options?

$(SONIC_BUILDER_EXTRA_CMDLINE)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it looks like SONIC_BUILDER_EXTRA_CMDLINE works for our use case. You can close this PR if you don't think it adds further value

DOCKER_RUN += $(foreach var,$(subst $(comma), ,$(DOCKER_USER_ENV)), $(addprefix -e , $(var)))
endif

# User name and tag for "docker-*" images created by native dockerd mode.
ifeq ($(strip $(SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD)),y)
DOCKER_USERNAME = $(USER_LC)
Expand Down