Skip to content

Commit

Permalink
Package CRIU
Browse files Browse the repository at this point in the history
  • Loading branch information
avmnu-sng committed Jan 31, 2024
1 parent 057a511 commit d120251
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 81 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ jobs:
BASE=${{ matrix.base }}
CRIU_VERSION=${{ matrix.criu }}
- name: Test
run: docker run --rm --privileged ${{ env.TAG_TEST }} criu check

- name: Test multi-stage build
run: |
cat <<EOF >> ${{ matrix.nftables }}-multi-stage.Dockerfile
FROM --platform=${{ env.PLATFORM }} ${{ matrix.base }}
COPY --from=${{ env.TAG_TEST }} /criu/ /
RUN apk --update --no-cache add libnet libnl3 nftables protobuf-c
EOF
if [[ $? != 0 ]]; then
Expand All @@ -73,7 +71,7 @@ jobs:
-f ${{ matrix.nftables }}-multi-stage.Dockerfile \
. && \
docker run --rm --privileged ${{ matrix.nftables }}-multi-stage:test criu check
docker run --rm --privileged ${{ matrix.nftables }}-multi-stage:test criu check --all -v4
- name: Login to Docker Hub
if: github.event_name == 'push'
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ then:
FROM --platform=amd64 alpine:3.18.5@sha256:d695c3de6fcd8cfe3a6222b0358425d40adfd129a8a47c3416faff1a8aece389

COPY --from=criu-with-nftables:criu-3.19-alpine-3.18.5 /criu/ /

# Install deps
RUN apk --update --no-cache add libnet libnl3 nftables protobuf-c
```
57 changes: 0 additions & 57 deletions multi-stage-setup.py

This file was deleted.

19 changes: 9 additions & 10 deletions with-nftables.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ FROM --platform=$PLATFORM $BASE
ARG CRIU_VERSION

RUN apk --update --no-cache add \
asciidoc \
bash \
build-base \
coreutils \
procps \
gcc \
git \
gnutls-dev \
libaio-dev \
libcap-dev \
libnet-dev \
Expand All @@ -24,19 +24,18 @@ RUN apk --update --no-cache add \
protobuf-dev \
py3-pip \
py3-protobuf \
py3-yaml \
python3 \
libcap-utils \
libdrm-dev \
util-linux

WORKDIR /tmp
util-linux \
xmlto

RUN wget "http://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}/criu-${CRIU_VERSION}.tar.gz" && \
tar -xzf "criu-${CRIU_VERSION}.tar.gz" && \
cd "criu-${CRIU_VERSION}" && \
make -j $(nproc) install-criu

COPY multi-stage-setup.py multi-stage-setup.py

RUN chmod +x multi-stage-setup.py && \
./multi-stage-setup.py
make -j $(nproc) CONFIG_AMDGPU=n PREFIX=/usr DESTDIR=/criu LIBDIR=/usr/lib LD=gcc install && \
rm -f /criu/usr/lib/*.a && \
rm -rf /criu/usr/lib/python3* && \
rm -rf /criu/usr/libexec/compel/*.a && \
rm -f /criu/usr/libexec/criu/scripts/systemd-autofs-restart.sh
19 changes: 9 additions & 10 deletions without-nftables.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ FROM --platform=$PLATFORM $BASE
ARG CRIU_VERSION

RUN apk --update --no-cache add \
asciidoc \
bash \
build-base \
coreutils \
procps \
gcc \
git \
gnutls-dev \
libaio-dev \
libcap-dev \
libnet-dev \
Expand All @@ -22,19 +22,18 @@ RUN apk --update --no-cache add \
protobuf-dev \
py3-pip \
py3-protobuf \
py3-yaml \
python3 \
libcap-utils \
libdrm-dev \
util-linux

WORKDIR /tmp
util-linux \
xmlto

RUN wget "http://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}/criu-${CRIU_VERSION}.tar.gz" && \
tar -xzf "criu-${CRIU_VERSION}.tar.gz" && \
cd "criu-${CRIU_VERSION}" && \
make -j $(nproc) install-criu

COPY multi-stage-setup.py multi-stage-setup.py

RUN chmod +x multi-stage-setup.py && \
./multi-stage-setup.py
make -j $(nproc) CONFIG_AMDGPU=n PREFIX=/usr DESTDIR=/criu LIBDIR=/usr/lib LD=gcc install && \
rm -f /criu/usr/lib/*.a && \
rm -rf /criu/usr/lib/python3* && \
rm -rf /criu/usr/libexec/compel/*.a && \
rm -f /criu/usr/libexec/criu/scripts/systemd-autofs-restart.sh

0 comments on commit d120251

Please sign in to comment.