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

Image Creation Loses Environment Variables #46

Open
smfsh opened this issue Nov 19, 2018 · 2 comments
Open

Image Creation Loses Environment Variables #46

smfsh opened this issue Nov 19, 2018 · 2 comments

Comments

@smfsh
Copy link
Collaborator

smfsh commented Nov 19, 2018

The images created secondarily from the original source (FROM scratch as php-dev COPY --from=php-base . /) do not inherit the environment variables from the base. The file structure is the same, but other Docker set items such as ENV and ENTRYPOINT are not inherited.

ENV specifically causes an issue with compiling xdebug (or other php extensions) because the script for it expects PHP_INI_DIR=/usr/local/etc/php to exist.

@smfsh
Copy link
Collaborator Author

smfsh commented Nov 19, 2018

For the php dev container, we might need to just add these environment variables if we cannot figure out a way to copy from a base image:

ENV PHP_INI_DIR /usr/local/etc/php
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
ENV PHP_TIMEZONE America/New_York
ENV PHP_LDFLAGS -Wl,-O1 -Wl,--hash-style=both -pie
ENV PHP_CFLAGS -fstack-protector-strong -fpic -fpie -O2
ENV PHP_CPPFLAGS -fstack-protector-strong -fpic -fpie -O2

smfsh added a commit that referenced this issue Nov 23, 2018
@jackinloadup
Copy link
Contributor

@smfsh Do you happen to know what is setting these environment variables in the php-base image to begin with?

First time I'm thinking about this issue but one option we might do is printenv into a file and then import that again after the move. Don't 100% know if it will work but I can test soon.

I this a solution to this will be important to make maintenance and expansion quicker and easier.

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

No branches or pull requests

2 participants