hugo, clean up the container after compiling hugo with go.
This commit is contained in:
1 parent
7a8f3cc095
commit
e4f5793106
1 file changed
+15
-1
@@ -10,19 +10,33 @@ USER root
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# System Dependencies
|
||||
run echo "Install Dependencies"
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
git nginx cron curl bash sudo \
|
||||
golang gcc ca-certificates && \
|
||||
ca-certificates \
|
||||
golang gcc && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Compile Hugo (same version Artix is currently shipping, rather than latest.)
|
||||
run echo "Compile Hugo"
|
||||
RUN CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.164.0
|
||||
|
||||
# Install Hugo
|
||||
run echo "Install Hugo"
|
||||
RUN mv -v $HOME/go/bin/hugo /usr/local/bin/hugo && \
|
||||
chmod -v 755 /usr/local/bin/hugo
|
||||
|
||||
RUN echo "Clean Up Go"
|
||||
RUN rm -rfv /usr/local/go \
|
||||
/root/go/pkg/mod \
|
||||
/root/.cache/go-build \
|
||||
/root/go \
|
||||
&& apt-get remove -y --purge golang gcc && \
|
||||
apt-get autoremove -y && \
|
||||
apt-get clean && \
|
||||
rm -rfv /var/lib/apt/lists/* /tmp/*
|
||||
|
||||
# User and Group
|
||||
#RUN groupadd -r hugo && useradd -r -g hugo hugo
|
||||
|
||||
|
||||
Reference in new issue
Block a user