Merge pull request #32100 from stormqueen1990/arm64

feat: arm64-compatible Dockerfile for local development
This commit is contained in:
Kubernetes Prow Robot
2022-03-15 10:08:10 -07:00
committed by GitHub
+22 -9
View File
@@ -4,29 +4,42 @@
# change is that the Hugo version is now an overridable argument rather than a fixed # change is that the Hugo version is now an overridable argument rather than a fixed
# environment variable. # environment variable.
FROM golang:1.15-alpine FROM golang:1.16-alpine
LABEL maintainer="Luc Perkins <lperkins@linuxfoundation.org>" LABEL maintainer="Luc Perkins <lperkins@linuxfoundation.org>"
RUN apk add --no-cache \ RUN apk add --no-cache \
curl \ curl \
git \ gcc \
openssh-client \ g++ \
rsync \ musl-dev \
build-base \ build-base \
libc6-compat \ libc6-compat
npm && \
npm install -D autoprefixer postcss-cli
ARG HUGO_VERSION ARG HUGO_VERSION
RUN mkdir $HOME/src && \
cd $HOME/src && \
curl -L https://github.com/gohugoio/hugo/archive/refs/tags/v${HUGO_VERSION}.tar.gz | tar -xz && \
cd "hugo-${HUGO_VERSION}" && \
go install --tags extended
FROM golang:1.16-alpine
RUN apk add --no-cache \
git \
openssh-client \
rsync \
npm && \
npm install -D autoprefixer postcss-cli
RUN mkdir -p /usr/local/src && \ RUN mkdir -p /usr/local/src && \
cd /usr/local/src && \ cd /usr/local/src && \
curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz | tar -xz && \
mv hugo /usr/local/bin/hugo && \
addgroup -Sg 1000 hugo && \ addgroup -Sg 1000 hugo && \
adduser -Sg hugo -u 1000 -h /src hugo adduser -Sg hugo -u 1000 -h /src hugo
COPY --from=0 /go/bin/hugo /usr/local/bin/hugo
WORKDIR /src WORKDIR /src
USER hugo:hugo USER hugo:hugo