From b9d75a3f92fba4b3046a94ef1dfb88073b019406 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Fri, 12 Apr 2024 09:57:30 +0200 Subject: [PATCH] fix(lint): Dockerfile FromAsCasing Fix incorrect `AS` casing as per the FromAsCasing Dockerfile lint rule Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- Dockerfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 786e339fdb..70e7c47e67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,41 +3,41 @@ ARG GO_VERSION=1.21 ARG HTMLTEST_VERSION=0.17.0 -FROM golang:${GO_VERSION}-alpine as base +FROM golang:${GO_VERSION}-alpine AS base WORKDIR /src RUN apk --update add nodejs npm git gcompat -FROM base as node +FROM base AS node COPY package*.json . ENV NODE_ENV=production RUN npm install -FROM base as hugo +FROM base AS hugo ARG HUGO_VERSION=0.122.0 ARG TARGETARCH WORKDIR /tmp/hugo RUN wget -O "hugo.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz" RUN tar -xf "hugo.tar.gz" hugo -FROM base as build-base +FROM base AS build-base COPY --from=hugo /tmp/hugo/hugo /bin/hugo COPY --from=node /src/node_modules /src/node_modules COPY . . -FROM build-base as dev +FROM build-base AS dev -FROM build-base as build +FROM build-base AS build ARG HUGO_ENV ARG DOCS_URL RUN hugo --gc --minify -d /out -e $HUGO_ENV -b $DOCS_URL -FROM scratch as release +FROM scratch AS release COPY --from=build /out / -FROM scratch as update-stats +FROM scratch AS update-stats COPY --from=build /src/hugo_stats.json /hugo_stats.json -FROM build as validate-stats +FROM build AS validate-stats RUN <&2 'ERROR: hugo_stats.json differs. Update with `docker buildx bake update-stats`' @@ -45,7 +45,7 @@ if [ -n "$(git status --porcelain -- hugo_stats.json)" ]; then fi EOF -FROM davidanson/markdownlint-cli2:v0.12.1 as lint +FROM davidanson/markdownlint-cli2:v0.12.1 AS lint USER root RUN --mount=type=bind,target=. \ /usr/local/bin/markdownlint-cli2 \ @@ -53,13 +53,13 @@ RUN --mount=type=bind,target=. \ "#content/engine/release-notes/*.md" \ "#content/desktop/previous-versions/*.md" -FROM wjdp/htmltest:v${HTMLTEST_VERSION} as test +FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS test WORKDIR /test COPY --from=build /out ./public ADD .htmltest.yml .htmltest.yml RUN htmltest -FROM build-base as update-modules +FROM build-base AS update-modules ARG MODULE RUN <<"EOT" set -ex @@ -73,18 +73,18 @@ fi EOT RUN hugo mod vendor -FROM scratch as vendor +FROM scratch AS vendor COPY --from=update-modules /src/_vendor /_vendor COPY --from=update-modules /src/go.* / -FROM build-base as build-upstream +FROM build-base AS build-upstream ARG UPSTREAM_MODULE_NAME ARG UPSTREAM_REPO ARG UPSTREAM_COMMIT ENV HUGO_MODULE_REPLACEMENTS="github.com/${UPSTREAM_MODULE_NAME} -> github.com/${UPSTREAM_REPO} ${UPSTREAM_COMMIT}" RUN hugo --ignoreVendorPaths "github.com/${UPSTREAM_MODULE_NAME}" -d /out -FROM wjdp/htmltest:v${HTMLTEST_VERSION} as validate-upstream +FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS validate-upstream WORKDIR /test COPY --from=build-upstream /out ./public ADD .htmltest.yml .htmltest.yml