Commit 45974c70 authored by kaiyou's avatar kaiyou
Browse files

Add a specific Dockerfile for simple k3s

parent 974ad30b
Pipeline #2116 failed with stage
in 7 minutes and 44 seconds
FROM golang:1.15.2-alpine3.12
# 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 sqlite-dev sqlite-static libselinux libselinux-dev zlib-dev zlib-static
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 off
ENV STATIC_BUILD true
COPY . /go/src/github.com/rancher/k3s
WORKDIR /go/src/github.com/rancher/k3s
RUN mkdir -p etc build/static build/data
RUN scripts/validate
RUN scripts/build
RUN scripts/package-cli
# Prepare the result image
FROM alpine:latest
RUN apk -U --no-cache add libseccomp iptables ip6tables socat ethtool pigz coreutils findutils bash
COPY --from=0 /go/src/github.com/rancher/k3s/dist/artifacts/k3s /go/src/github.com/racher/k3s/package/entrypoint.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
#!/bin/sh
mount --make-shared /
exec /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