Skip to content

Commit

Permalink
build: standardize Dockerfile 'AS' syntax for multi-stage builds
Browse files Browse the repository at this point in the history
- Change `FROM` statements to use uppercase `AS` for stage names in `Dockerfile`, `alpine.Dockerfile`, and `distroless.Dockerfile`.

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed Oct 3, 2024
1 parent c8c4049 commit 63e63a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG RELEASE=0
########################################
# Final stage
########################################
FROM alpine:3 as final
FROM alpine:3 AS final

# RUN mount cache for multi-arch: https://github.com/docker/buildx/issues/549#issuecomment-1788297892
ARG TARGETARCH
Expand Down
4 changes: 2 additions & 2 deletions alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG RELEASE=0
########################################
# Build stage
########################################
FROM python:3.12-alpine as build
FROM python:3.12-alpine AS build

# RUN mount cache for multi-arch: https://github.com/docker/buildx/issues/549#issuecomment-1788297892
ARG TARGETARCH
Expand All @@ -32,7 +32,7 @@ RUN --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/r
########################################
# Final stage
########################################
FROM python:3.12-alpine as final
FROM python:3.12-alpine AS final

RUN pip3.12 uninstall -y setuptools pip wheel && \
rm -rf /root/.cache/pip
Expand Down
4 changes: 2 additions & 2 deletions distroless.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG RELEASE=0
########################################
# Build stage
########################################
FROM python:3.12-bookworm as build
FROM python:3.12-bookworm AS build

# RUN mount cache for multi-arch: https://github.com/docker/buildx/issues/549#issuecomment-1788297892
ARG TARGETARCH
Expand Down Expand Up @@ -35,7 +35,7 @@ RUN --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/r
# Final stage
# Distroless image use monty(1000) for non-root user
########################################
FROM al3xos/python-distroless:3.12-debian12 as final
FROM al3xos/python-distroless:3.12-debian12 AS final

ARG UID=1000

Expand Down

0 comments on commit 63e63a8

Please sign in to comment.