Commit 4f2355c7 authored by kaiyou's avatar kaiyou
Browse files

Lower the build size and set the entrypoint

parent 07227b4b
Pipeline #1381 passed with stage
in 11 minutes and 18 seconds
......@@ -4,22 +4,23 @@ FROM golang:1.13.11-alpine3.10
RUN apk -U --no-cache add bash git gcc musl-dev docker vim less file curl wget ca-certificates jq linux-headers zlib-dev tar zip squashfs-tools npm coreutils \
python2 openssl-dev libffi-dev libseccomp libseccomp-dev make libuv-static
RUN apk -U --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/main/ add sqlite-dev sqlite-static libselinux libselinux-dev
RUN mkdir -p /go/src/golang.org/x && \
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && cd tools && \
git checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
go install golang.org/x/tools/cmd/goimports && cd
RUN rm -rf /go/src /go/pkg
RUN mkdir -p /go/src/golang.org/x \
&& cd /go/src/golang.org/x && git clone https://github.com/golang/tools && cd tools \
&& git checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 \
&& go install golang.org/x/tools/cmd/goimports \
&& rm -rf /go/src /go/pkg
# Actually build k3s
ENV GO111MODULE on
ADD . /build
WORKDIR /build
RUN scripts/build
RUN mkdir -p etc build/static \
RUN scripts/build \
&& mkdir -p etc build/static \
&& scripts/package-cli
# Prepare the result image
FROM alpine:latest
RUN apk -U --no-cache add iptables ip6tables socat ethtool pigz open-iscsi
RUN apk -U --no-cache add libseccomp iptables ip6tables socat ethtool pigz open-iscsi
COPY --from=0 /build/dist/artifacts/k3s /usr/local/bin/k3s
ENTRYPOINT ["/usr/local/bin/k3s"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment