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 py-fapi-31-slim.Dockerfile \
    --target build-py-fapi-31-slim \
    --no-cache \
    --build-arg APP_VER=local \
    -t py-fapi-31-slim:latest \
    .

Notes

  • Using -f py-fapi-31-slim.Dockerfile

    To specify py-fapi-31-slim.Dockerfile as the filename to build otherwise it is expected to be named just Dockerfile.

  • Using --target build-py-fapi-31-slim

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

  • Using --no-cache

    To prevent using previous cached versions of image build stages.

  • Using --build-arg APP_VER=local

    To set build arguments & values to use during the build process.

  • Using -t py-fapi-31-slim: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