mirror of
https://github.com/rancher/steve.git
synced 2025-04-27 19:05:09 +00:00
24 lines
680 B
Docker
24 lines
680 B
Docker
# syntax = docker/dockerfile:experimental
|
|
FROM registry.suse.com/bci/golang:1.22 as build
|
|
COPY go.mod go.sum main.go /src/
|
|
COPY pkg /src/pkg/
|
|
#RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
RUN \
|
|
cd /src && \
|
|
CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o /steve
|
|
|
|
FROM registry.suse.com/bci/bci-micro:15.5
|
|
|
|
ARG user=steve
|
|
|
|
RUN echo "$user:x:1000:1000::/home/$user:/bin/bash" >> /etc/passwd && \
|
|
echo "$user:x:1000:" >> /etc/group && \
|
|
mkdir /home/$user && \
|
|
chown -R $user:$user /home/$user
|
|
|
|
COPY --from=build /steve /usr/bin/steve
|
|
# Hack to make golang do files,dns search order
|
|
ENV LOCALDOMAIN=""
|
|
USER $user
|
|
ENTRYPOINT ["/usr/bin/steve"]
|