Skip to content

Build Image

Evil Wizard edited this page Feb 18, 2023 · 11 revisions

No Cache

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

Helper Script

A helper script is available with the repo to force recreate the build & use the docker-compose.yaml file which reads the .env file.

./build-web.sh

The long Way

sudo docker build \
    -f php-5-6-apache.Dockerfile \
    --target php-5-6-build \
    --build-arg APP_ENV=local \
    --build-arg NPM_VERSION=6.4.1 \
    --no-cache \
    -t php-5-6-web-server:latest \
    .

Notes

  • Using -f php-5-6-apache.Dockerfile

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

  • Using --target php-5-6-build

    To select the build target stage[^multi_stage_builds_note] from the Dockerfile.

  • Using --build-arg ARG=value

    To set build argument values to use.

Clone this wiki locally