Skip to content

Build Image

Evil Wizard edited this page Nov 6, 2023 · 1 revision

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

The long Way

sudo docker build \
    -f php-5-6-cli.Dockerfile \
    --target build-56-cli \
    --no-cache \
    -t php-5-6-cli:latest \
    .

Notes

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

    To specify php-5-6-cli.Dockerfile as the filename to build otherwise it is expected to be named just Dockerfile.

  • Using --target build-56-cli

    To select the build target stage from the Dockerfile.

  • Using --no-cache

    To prevent using previous cached versions of image build stages.

  • Using -t php-5-6-cli:latest

    To name & tag the locally built docker image.

  • Using .

    To set the current location as the build context for the build process.

Clone this wiki locally