Skip to content

Commit

Permalink
add new stages to makefile and also enable BUILDKIT
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
  • Loading branch information
jacobsalmela committed Mar 13, 2023
1 parent 34a0b9d commit 804cf1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,25 @@ image: prod_image
docker tag '${NAME}:${VERSION}' '${NAME}:${VERSION}-p${PYTHON_VERSION}'

deps_image:
docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-deps' -f Dockerfile --target deps .
BUILDKIT=1 docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-deps' -f Dockerfile --target deps .

ansible_image:
BUILDKIT=1 docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-deps' -f Dockerfile --target ansible .

dev_image:
docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-dev' -f Dockerfile --target dev .
BUILDKIT=1 docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-dev' -f Dockerfile --target dev .

docs_image:
docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-docs' -f Dockerfile --target docs .
BUILDKIT=1 docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-docs' -f Dockerfile --target docs .

build_image:
docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-build' -f Dockerfile --target build .
BUILDKIT=1 docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-build' -f Dockerfile --target build .

build_image_prod:
BUILDKIT=1 docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}-build' -f Dockerfile --target prod_build .

prod_image:
docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --tag '${NAME}:${VERSION}' -f Dockerfile --target prod .
BUILDKIT=1 docker build --progress plain --no-cache --pull --build-arg 'PYTHON_VERSION=${PYTHON_VERSION}' --build-arg 'ALPINE_IMAGE=${ALPINE_IMAGE}' --build-arg 'ALPINE_VERSION=${ALPINE_VERSION}' --tag '${NAME}:${VERSION}' -f Dockerfile --target prod .

dev:
./canuctl -d
Expand Down
2 changes: 1 addition & 1 deletion canuctl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ main() {

# if that fails, try to build it and tag the image
if [[ "${REBUILD:-}" == "true" ]]; then
if "${PLATFORM}" build \
if BUILDKIT=1 "${PLATFORM}" build \
--build-arg ALPINE_IMAGE="${ALPINE_IMAGE}" \
--build-arg PYTHON_VERSION="${PYTHON_VERSION}" \
--build-arg ALPINE_VERSION="${ALPINE_VERSION}" \
Expand Down

0 comments on commit 804cf1a

Please sign in to comment.