2022-11-27 01:37:19 +00:00
|
|
|
FROM golang:1.18.3-stretch
|
2021-08-26 14:11:38 +00:00
|
|
|
|
2023-03-07 14:50:33 +00:00
|
|
|
# Currenrtly supported versions: UDM-Base UDM-Pro-SE
|
2023-03-07 14:49:28 +00:00
|
|
|
ARG UDM_PLATFORM=UDM-Base
|
2021-08-26 14:11:38 +00:00
|
|
|
|
2023-03-06 16:48:21 +00:00
|
|
|
ARG PODMAN_VERSION=v4.4.2
|
2022-11-27 01:29:04 +00:00
|
|
|
ARG RUNC_VERSION=v1.1.4
|
2023-03-06 16:48:21 +00:00
|
|
|
ARG CONMON_VERSION=v2.1.7
|
2022-02-06 20:29:45 +00:00
|
|
|
|
2022-02-24 08:27:37 +00:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
bc \
|
|
|
|
binutils-aarch64-linux-gnu \
|
|
|
|
bison \
|
|
|
|
build-essential \
|
|
|
|
flex \
|
|
|
|
gcc-aarch64-linux-gnu \
|
|
|
|
git \
|
|
|
|
libc6-arm64-cross \
|
|
|
|
libc6-dev-arm64-cross \
|
|
|
|
libncurses5-dev \
|
|
|
|
libssl-dev \
|
|
|
|
pkg-config \
|
|
|
|
systemd \
|
|
|
|
zip \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN dpkg --add-architecture arm64
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
gperf:arm64 \
|
|
|
|
libglib2.0-dev:arm64 \
|
|
|
|
libseccomp-dev:arm64 \
|
|
|
|
libsystemd-dev:arm64 \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2021-08-26 14:11:38 +00:00
|
|
|
ENV GOOS=linux
|
2022-02-06 20:29:45 +00:00
|
|
|
|
2022-02-24 08:27:37 +00:00
|
|
|
COPY ./podman.Makefile.${UDM_PLATFORM}.patch /tmp
|
|
|
|
RUN mkdir -p /build \
|
|
|
|
&& mkdir -p /tmp/release
|
2021-08-26 14:11:38 +00:00
|
|
|
WORKDIR /build
|
2022-02-24 08:27:37 +00:00
|
|
|
RUN git clone https://github.com/containers/podman.git \
|
|
|
|
&& git clone https://github.com/opencontainers/runc.git \
|
|
|
|
&& git clone https://github.com/containers/conmon.git
|
2022-02-06 20:29:45 +00:00
|
|
|
WORKDIR /build/runc
|
|
|
|
|
2022-02-24 08:27:37 +00:00
|
|
|
RUN git checkout ${RUNC_VERSION} \
|
|
|
|
&& ./script/release_build.sh -a arm64 -r /tmp/release
|
2022-02-06 20:29:45 +00:00
|
|
|
ENV PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/
|
|
|
|
ENV GOARCH=arm64
|
|
|
|
ENV CC='aarch64-linux-gnu-gcc'
|
2021-08-26 14:11:38 +00:00
|
|
|
WORKDIR /build/podman
|
2022-02-24 08:27:37 +00:00
|
|
|
RUN git checkout ${PODMAN_VERSION} \
|
|
|
|
&& patch Makefile /tmp/podman.Makefile.${UDM_PLATFORM}.patch \
|
|
|
|
&& make vendor local-cross \
|
|
|
|
&& cp ./bin/podman.cross.linux.arm64 /tmp/release/podman-${PODMAN_VERSION} \
|
|
|
|
&& chmod +x /tmp/release/podman-${PODMAN_VERSION}
|
2021-08-26 14:11:38 +00:00
|
|
|
|
|
|
|
WORKDIR /build/conmon
|
2022-02-24 08:27:37 +00:00
|
|
|
RUN git checkout ${CONMON_VERSION} \
|
|
|
|
&& make vendor bin/conmon \
|
|
|
|
&& cp bin/conmon /tmp/release/conmon-${CONMON_VERSION} \
|
|
|
|
&& chmod +x /tmp/release/conmon-$CONMON_VERSION
|
2021-08-26 14:11:38 +00:00
|
|
|
|
2023-03-07 15:06:18 +00:00
|
|
|
RUN mkdir -p /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/usr/bin \
|
2023-03-07 14:39:00 +00:00
|
|
|
&& mkdir -p /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/usr/libexec/podman/ \
|
|
|
|
&& mkdir -p /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/usr/share/containers/ \
|
|
|
|
&& mkdir -p /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/etc/containers/
|
|
|
|
|
|
|
|
|
|
|
|
COPY seccomp.json /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/usr/share/containers/
|
2023-03-07 14:57:27 +00:00
|
|
|
COPY containers.conf /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/etc/containers/
|
2023-03-07 14:39:00 +00:00
|
|
|
COPY storage.conf /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/usr/share/containers/
|
|
|
|
COPY registries.conf /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/etc/containers/
|
|
|
|
COPY policy.json /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/etc/containers/
|
2022-02-06 20:29:45 +00:00
|
|
|
|
2023-03-07 14:39:00 +00:00
|
|
|
RUN cp /tmp/release/podman-${PODMAN_VERSION} /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/usr/bin/podman \
|
2023-03-07 14:46:12 +00:00
|
|
|
&& cp /tmp/release/runc.arm64 /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/usr/bin/runc \
|
2023-03-07 14:39:00 +00:00
|
|
|
&& cp /tmp/release/conmon-${CONMON_VERSION} /tmp/install/podman-${PODMAN_VERSION}-${UDM_PLATFORM}/usr/libexec/podman/conmon
|
2021-08-26 14:11:38 +00:00
|
|
|
WORKDIR /tmp/install
|
|
|
|
|
2022-02-24 08:27:37 +00:00
|
|
|
# Zip up the files
|
2023-03-07 14:39:00 +00:00
|
|
|
#RUN zip -r /tmp/release/podman-install.zip *
|