Skip to content

Use ARG instead of ENV for some variables #347

Closed
@EvgenyOrekhov

Description

@EvgenyOrekhov
ENV CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
ENV CPPFLAGS="$CFLAGS"
ENV LDFLAGS="-Wl,-O1 -Wl,--hash-style=both"

ENV CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
ENV CPPFLAGS="$CFLAGS"
ENV LDFLAGS="-Wl,-O1 -Wl,--hash-style=both"

These ENV variables are persisted into the built image, which makes using php:fpm-alpine as the base image problematic (for example when one wants to build something from source these variables will interfere with the build process and break it).

Here is an example of a relevant issue of a failing compilation process when using php:fpm-alpine as the base image: openresty/docker-openresty#25.

The ARG instruction should be used to avoid that problem.

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