Skip to content

Build Image

Evil Wizard edited this page Mar 9, 2023 · 3 revisions

No Cache

Build the Docker Image without using cached versions of previous image build stages.

sudo docker build \
    -f php-7-4-apache.Dockerfile \
    --target php-7-4-build \
    --build-arg APP_ENV=local \
    --build-arg NPM_VERSION=7.24.2 \
    --no-cache \
    -t php-7-4-web-server:latest \
    .

Notes

  • Using -f php-7-4-apache.Dockerfile

    To specify the filename to build otherwise it is expected to be named Dockerfile.

  • Using --target php-7-4-build

    To select the build target stage from the Dockerfile, used mostly in Multi Stage image builds.

  • Using --build-arg ARG=value

    To set build argument values to use.

Clone this wiki locally