From 48947b3d4d84f0e03218bbac6a310f82adfdc1e2 Mon Sep 17 00:00:00 2001 From: wheat2018 <1151937289@qq.com> Date: Thu, 15 Aug 2024 02:56:12 +0000 Subject: [PATCH] Add Dockerfile Signed-off-by: wheat2018 <1151937289@qq.com> --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ README.md | 14 ++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..500c7699 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM ubuntu:22.04 AS builder + +WORKDIR /go/src/github.com +ARG TARGETARCH + +RUN apt update && apt install -y \ + libcurl4-openssl-dev libssl-dev libaio-dev libnl-3-dev libnl-genl-3-dev libgflags-dev libzstd-dev libext2fs-dev libgtest-dev libtool zlib1g-dev e2fsprogs \ + sudo pkg-config autoconf automake \ + g++ cmake make wget git curl \ + && apt clean \ + && wget https://go.dev/dl/go1.22.5.linux-${TARGETARCH}.tar.gz \ + && tar -C /usr/local -xzf go1.22.5.linux-${TARGETARCH}.tar.gz \ + && rm go1.22.5.linux-${TARGETARCH}.tar.gz + +COPY ./overlaybd ./overlaybd +COPY ./accelerated-container-image ./accelerated-container-image + +RUN export PATH=$PATH:/usr/local/go/bin && \ + cd overlaybd && rm -rf build && mkdir build && cd build && cmake ../ && make -j && make install && cd ../.. && \ + cd accelerated-container-image && make -j && make install + +FROM ubuntu:22.04 + +COPY --from=builder /opt/overlaybd /opt/overlaybd +COPY --from=builder /etc/overlaybd /etc/overlaybd +COPY --from=builder /etc/overlaybd-snapshotter /etc/overlaybd-snapshotter + +RUN apt update && apt install -y \ + libcurl4-openssl-dev libaio-dev \ + && apt clean + +ENTRYPOINT ["/opt/overlaybd/snapshotter/convertor"] diff --git a/README.md b/README.md index 014c16e6..10394587 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,20 @@ Accelerated Container Image is a __non-core__ sub-project of containerd. It is an overlaybd-based remote image format which enables the original OCI image to be a remote one without conversion. It is similar to [SOCI](https://github.com/awslabs/soci-snapshotter), but provides block device interface, which has advantages than FUSE-based formats in performance and stability. +## Docker Image + +The `Dockerfile` is supplied to build the image of the overlaybd convertor. You can build the docker image by yourself as follows: + +``` +docker build -f Dockerfile -t overlaybd-convertor . +``` + +Then run the overlaybd convertor image (see [QUICKSTART](docs/QUICKSTART.md) for more details): + +``` +docker run overlaybd-convertor -r registry.hub.docker.com/library/redis -i 6.2.1 -o 6.2.1_obd_new +``` + ## Getting Started * [QUICKSTART](docs/QUICKSTART.md) helps quickly run an overlaybd image including basic usage.