Skip to content

Commit

Permalink
style: standardize Dockerfile stage naming conventions
Browse files Browse the repository at this point in the history
FromAsCasing: 'as' and 'FROM' keywords' casing do not match

- Standardize Dockerfile stage naming conventions to use uppercase `AS` instead of lowercase `as`.

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed Aug 25, 2024
1 parent a78d3dd commit 6e10c76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ARG HF_HOME=${CACHE_HOME}/huggingface
########################################
# Base stage
########################################
FROM python:3.11-slim as base
FROM python:3.11-slim AS base

# RUN mount cache for multi-arch: https://github.com/docker/buildx/issues/549#issuecomment-1788297892
ARG TARGETARCH
Expand All @@ -40,7 +40,7 @@ RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/v
########################################
# Build stage
########################################
FROM base as build
FROM base AS build

# RUN mount cache for multi-arch: https://github.com/docker/buildx/issues/549#issuecomment-1788297892
ARG TARGETARCH
Expand Down Expand Up @@ -79,7 +79,7 @@ RUN --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/r
########################################
# Final stage for no_model
########################################
FROM base as no_model
FROM base AS no_model

ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
Expand Down Expand Up @@ -158,7 +158,7 @@ LABEL name="jim60105/docker-whisperX" \
# load_whisper stage
# This stage will be tagged for caching in CI.
########################################
FROM ${NO_MODEL_STAGE} as load_whisper
FROM ${NO_MODEL_STAGE} AS load_whisper

ARG TORCH_HOME
ARG HF_HOME
Expand All @@ -173,7 +173,7 @@ RUN python3 -c 'import faster_whisper; model = faster_whisper.WhisperModel("'${W
########################################
# load_align stage
########################################
FROM ${LOAD_WHISPER_STAGE} as load_align
FROM ${LOAD_WHISPER_STAGE} AS load_align

ARG TORCH_HOME
ARG HF_HOME
Expand All @@ -187,7 +187,7 @@ RUN --mount=source=load_align_model.py,target=load_align_model.py \
########################################
# Final stage with model
########################################
FROM ${NO_MODEL_STAGE} as final
FROM ${NO_MODEL_STAGE} AS final

ARG UID

Expand Down
12 changes: 6 additions & 6 deletions ubi.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ARG HF_HOME=${CACHE_HOME}/huggingface
########################################
# Base stage
########################################
FROM registry.access.redhat.com/ubi9/ubi-minimal as base
FROM registry.access.redhat.com/ubi9/ubi-minimal AS base

ENV PYTHON_VERSION=3.11
ENV PYTHONUNBUFFERED=1
Expand All @@ -43,7 +43,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
########################################
# Build stage
########################################
FROM base as build
FROM base AS build

# Install build time requirements
RUN microdnf -y install --setopt=install_weak_deps=0 --setopt=tsflags=nodocs git python3.11-pip findutils && \
Expand Down Expand Up @@ -86,7 +86,7 @@ RUN --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/r
########################################
# Final stage for no_model
########################################
FROM base as no_model
FROM base AS no_model

ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
Expand Down Expand Up @@ -157,7 +157,7 @@ LABEL name="jim60105/docker-whisperX" \
# load_whisper stage
# This stage will be tagged for caching in CI.
########################################
FROM ${NO_MODEL_STAGE} as load_whisper
FROM ${NO_MODEL_STAGE} AS load_whisper

ARG TORCH_HOME
ARG HF_HOME
Expand All @@ -172,7 +172,7 @@ RUN python3 -c 'import faster_whisper; model = faster_whisper.WhisperModel("'${W
########################################
# load_align stage
########################################
FROM ${LOAD_WHISPER_STAGE} as load_align
FROM ${LOAD_WHISPER_STAGE} AS load_align

ARG TORCH_HOME
ARG HF_HOME
Expand All @@ -186,7 +186,7 @@ RUN --mount=source=load_align_model.py,target=load_align_model.py \
########################################
# Final stage with model
########################################
FROM ${NO_MODEL_STAGE} as final
FROM ${NO_MODEL_STAGE} AS final

ARG UID

Expand Down

0 comments on commit 6e10c76

Please sign in to comment.