Commit 07227b4b authored by kaiyou's avatar kaiyou
Browse files

Build an alpine-based Docker image

parent 96653e8d
Pipeline #1373 passed with stage
in 13 minutes and 14 seconds
......@@ -5,3 +5,4 @@
\ No newline at end of file
FROM golang:1.13.11-alpine3.10
# Prepare the build environment
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 add sqlite-dev sqlite-static libselinux libselinux-dev
RUN mkdir -p /go/src/ && \
cd /go/src/ && git clone && cd tools && \
git checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
go install && cd
RUN rm -rf /go/src /go/pkg
# Actually build k3s
ADD . /build
WORKDIR /build
RUN scripts/build
RUN 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
COPY --from=0 /build/dist/artifacts/k3s /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