forked from mgoltzsche/podman-static
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-remote
26 lines (24 loc) · 1.16 KB
/
Dockerfile-remote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# podman build base
FROM golang:1.19-alpine3.18 AS podmanbuildbase
RUN apk add --update --no-cache git make gcc pkgconf musl-dev \
btrfs-progs btrfs-progs-dev libassuan-dev lvm2-dev device-mapper \
glib-static libc-dev gpgme-dev protobuf-dev protobuf-c-dev \
libseccomp-dev libseccomp-static libselinux-dev ostree-dev openssl iptables \
bash go-md2man
# podman remote
FROM podmanbuildbase AS podman-remote
RUN apk add --update --no-cache curl
ARG PODMAN_VERSION=v4.7.1
RUN git clone -c advice.detachedHead=false --depth=1 --branch=${PODMAN_VERSION} https://github.com/containers/podman src/github.com/containers/podman
WORKDIR $GOPATH/src/github.com/containers/podman
RUN make install.tools
RUN set -eux; \
make bin/podman-remote LDFLAGS_PODMAN="-s -w -extldflags '-static'"; \
mv bin/podman-remote /usr/local/bin/podman-remote; \
ln -s podman-remote /usr/local/bin/podman; \
ln -s podman-remote /usr/local/bin/docker; \
podman --help >/dev/null; \
[ "$(ldd /usr/local/bin/podman-remote | wc -l)" -eq 0 ] || (ldd /usr/local/bin/podman-remote; false)
FROM alpine:3.18
COPY --from=podman-remote /usr/local/bin /usr/local/bin
RUN adduser -D podman-remote -h /podman -u 1000