2020-01-31 05:37:59 +00:00
|
|
|
# syntax = docker/dockerfile:experimental
|
2024-02-18 04:39:24 +00:00
|
|
|
FROM registry.suse.com/bci/golang:1.22 as build
|
2020-04-16 05:50:00 +00:00
|
|
|
COPY go.mod go.sum main.go /src/
|
2019-08-04 17:41:32 +00:00
|
|
|
COPY pkg /src/pkg/
|
2020-02-22 05:28:09 +00:00
|
|
|
#RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
|
|
RUN \
|
2020-01-31 05:37:59 +00:00
|
|
|
cd /src && \
|
2020-04-16 05:50:00 +00:00
|
|
|
CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o /steve
|
2019-08-04 17:41:32 +00:00
|
|
|
|
2023-09-13 14:00:48 +00:00
|
|
|
FROM registry.suse.com/bci/bci-micro:15.5
|
2023-09-12 22:50:39 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2019-09-11 21:05:00 +00:00
|
|
|
COPY --from=build /steve /usr/bin/steve
|
2019-08-08 05:42:29 +00:00
|
|
|
# Hack to make golang do files,dns search order
|
|
|
|
ENV LOCALDOMAIN=""
|
2023-09-12 22:50:39 +00:00
|
|
|
USER $user
|
2019-09-11 21:05:00 +00:00
|
|
|
ENTRYPOINT ["/usr/bin/steve"]
|