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 @@
./.cache
./.dapper
./.trash-cache
./Dockerfile
\ 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 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
# Actually build k3s
ENV GO111MODULE on
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