Skip to content

Image Creation Loses Environment Variables #46

Description

@smfsh

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.

Activity

  1. smfsh commented on Nov 19, 2018

    @smfsh
    CollaboratorAuthor

    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

  2. added a commit that references this issue on Nov 23, 2018
  3. jackinloadup commented on May 23, 2019

    @jackinloadup
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions