|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -ARG CONTAINERD_VERSION=v1.4.3 |
16 | | -ARG RUNC_VERSION=v1.0.0-rc92 |
| 15 | +ARG CONTAINERD_VERSION=v1.5.0-beta.2 |
| 16 | +ARG RUNC_VERSION=v1.0.0-rc93 |
17 | 17 | ARG CNI_PLUGINS_VERSION=v0.9.0 |
18 | 18 | ARG NERDCTL_VERSION=0.6.0 |
| 19 | +ARG PODMAN_VERSION=2314af70bdacf75135a11b48b87dba8e461a43ea |
| 20 | +ARG CONTAINERS_IMAGE_VERSION=1d45144111969eb7160be0fd32a82ada5f3bca7a |
| 21 | +ARG CONTAINERS_STORAGE_VERSION=4d4212f14a5cc5256b330e08e9f4c770a14c0a04 |
| 22 | +ARG CRUN_VERSION=0.17 |
| 23 | +ARG CONMON_VERSION=v2.0.26 |
| 24 | +ARG SKOPEO_VERSION=v1.2.2 |
19 | 25 |
|
20 | 26 | # Legacy builder that doesn't support TARGETARCH should set this explicitly using --build-arg. |
21 | 27 | # If TARGETARCH isn't supported by the builder, the default value is "amd64". |
@@ -65,6 +71,55 @@ RUN cd $GOPATH/src/github.com/containerd/stargz-snapshotter && \ |
65 | 71 | PREFIX=/out/ GOARCH=${TARGETARCH:-amd64} GO_BUILD_FLAGS=${SNAPSHOTTER_BUILD_FLAGS} make containerd-stargz-grpc && \ |
66 | 72 | PREFIX=/out/ GOARCH=${TARGETARCH:-amd64} GO_BUILD_FLAGS=${CTR_REMOTE_BUILD_FLAGS} make ctr-remote |
67 | 73 |
|
| 74 | +# Build registry storage |
| 75 | +FROM golang-base AS registry-storage-dev |
| 76 | +ARG TARGETARCH |
| 77 | +ARG GOARM |
| 78 | +ARG SNAPSHOTTER_BUILD_FLAGS |
| 79 | +ARG CTR_REMOTE_BUILD_FLAGS |
| 80 | +COPY . $GOPATH/src/github.com/containerd/stargz-snapshotter |
| 81 | +RUN cd $GOPATH/src/github.com/containerd/stargz-snapshotter && \ |
| 82 | + PREFIX=/out/ GOARCH=${TARGETARCH:-amd64} GO_BUILD_FLAGS=${SNAPSHOTTER_BUILD_FLAGS} make registry-storage |
| 83 | + |
| 84 | +# Build podman |
| 85 | +FROM golang-base AS podman-dev |
| 86 | +ARG PODMAN_VERSION |
| 87 | +ARG CONTAINERS_IMAGE_VERSION |
| 88 | +ARG CONTAINERS_STORAGE_VERSION |
| 89 | +RUN apt-get update -y && apt-get install -y libseccomp-dev libgpgme-dev && \ |
| 90 | + git clone https://github.com/ktock/storage $GOPATH/src/github.com/containers/storage && \ |
| 91 | + cd $GOPATH/src/github.com/containers/storage && \ |
| 92 | + git checkout ${CONTAINERS_STORAGE_VERSION} && \ |
| 93 | + git clone https://github.com/ktock/image $GOPATH/src/github.com/containers/image && \ |
| 94 | + cd $GOPATH/src/github.com/containers/image && \ |
| 95 | + git checkout ${CONTAINERS_IMAGE_VERSION} && \ |
| 96 | + git clone https://github.com/containers/podman $GOPATH/src/github.com/containers/podman && \ |
| 97 | + cd $GOPATH/src/github.com/containers/podman && \ |
| 98 | + git checkout ${PODMAN_VERSION} && \ |
| 99 | + sed -i "s/-mod=vendor//g" $GOPATH/src/github.com/containers/podman/Makefile && \ |
| 100 | + echo "replace github.com/containers/image/v5 => /go/src/github.com/containers/image\nreplace github.com/containers/storage => /go/src/github.com/containers/storage" >> $GOPATH/src/github.com/containers/podman/go.mod && \ |
| 101 | + make && make install PREFIX=/out/ |
| 102 | + |
| 103 | +# Build crun |
| 104 | +FROM golang-base AS crun-dev |
| 105 | +ARG CRUN_VERSION |
| 106 | +RUN apt-get update -y && apt-get install -y make git gcc build-essential pkgconf libtool \ |
| 107 | + libsystemd-dev libcap-dev libseccomp-dev libyajl-dev \ |
| 108 | + go-md2man libtool autoconf python3 automake && \ |
| 109 | + git clone -b ${CRUN_VERSION} --depth 1 \ |
| 110 | + https://github.com/containers/crun $GOPATH/src/github.com/containers/crun && \ |
| 111 | + cd $GOPATH/src/github.com/containers/crun && \ |
| 112 | + ./autogen.sh && ./configure --prefix=/out/ && make && make install |
| 113 | + |
| 114 | +# Build conmon |
| 115 | +FROM golang-base AS conmon-dev |
| 116 | +ARG CONMON_VERSION |
| 117 | +RUN apt-get update -y && apt-get install -y gcc git libc6-dev libglib2.0-dev pkg-config make && \ |
| 118 | + git clone -b ${CONMON_VERSION} --depth 1 \ |
| 119 | + https://github.com/containers/conmon $GOPATH/src/github.com/containers/conmon && \ |
| 120 | + cd $GOPATH/src/github.com/containers/conmon && \ |
| 121 | + mkdir /out/ && make && make install PREFIX=/out/ |
| 122 | + |
68 | 123 | # Binaries for release |
69 | 124 | FROM scratch AS release-binaries |
70 | 125 | COPY --from=snapshotter-dev /out/* / |
@@ -98,6 +153,28 @@ COPY --from=runc-dev /out/sbin/* /usr/local/sbin/ |
98 | 153 | COPY --from=snapshotter-dev /out/ctr-remote /usr/local/bin/ |
99 | 154 | RUN ln -s /usr/local/bin/ctr-remote /usr/local/bin/ctr |
100 | 155 |
|
| 156 | +# Base image which contains podman with registry-storage |
| 157 | +FROM golang-base AS podman-base |
| 158 | +ARG TARGETARCH |
| 159 | +ARG CNI_PLUGINS_VERSION |
| 160 | +ARG PODMAN_VERSION |
| 161 | +ARG SKOPEO_VERSION |
| 162 | +RUN apt-get update -y && apt-get --no-install-recommends install -y fuse libgpgme-dev \ |
| 163 | + iptables libyajl-dev && \ |
| 164 | + # Make CNI plugins manipulate iptables instead of nftables |
| 165 | + # as this test runs in a Docker container that network is configured with iptables. |
| 166 | + # c.f. https://github.com/moby/moby/issues/26824 |
| 167 | + update-alternatives --set iptables /usr/sbin/iptables-legacy && \ |
| 168 | + mkdir -p /etc/containers /etc/cni/net.d /opt/cni/bin && \ |
| 169 | + curl -L -o /etc/containers/policy.json https://raw.githubusercontent.com/containers/skopeo/${SKOPEO_VERSION}/default-policy.json && \ |
| 170 | + curl -qsSL https://raw.githubusercontent.com/containers/podman/${PODMAN_VERSION}/cni/87-podman-bridge.conflist | tee /etc/cni/net.d/87-podman-bridge.conflist && \ |
| 171 | + curl -Ls https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/cni-plugins-linux-${TARGETARCH:-amd64}-${CNI_PLUGINS_VERSION}.tgz | tar xzv -C /opt/cni/bin |
| 172 | + |
| 173 | +COPY --from=podman-dev /out/bin/* /usr/local/bin/ |
| 174 | +COPY --from=crun-dev /out/bin/* /usr/local/bin/ |
| 175 | +COPY --from=conmon-dev /out/bin/* /usr/local/bin/ |
| 176 | +COPY --from=registry-storage-dev /out/* /usr/local/bin/ |
| 177 | + |
101 | 178 | # Image which can be used as all-in-one single node demo environment |
102 | 179 | FROM snapshotter-base AS cind |
103 | 180 | COPY ./script/config/ / |
|
0 commit comments