File: Dockerfile

package info (click to toggle)
image-garden 0.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 564 kB
  • sloc: sh: 515; python: 305; makefile: 189
file content (93 lines) | stat: -rw-r--r-- 2,655 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# syntax=docker/dockerfile:1
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Zygmunt Krynicki

FROM ubuntu:latest AS build-qemu
ADD --checksum=sha256:9e30ad1b8b9f7b4463001582d1ab297f39cfccea5d08540c0ca6d6672785883a https://download.qemu.org/qemu-10.2.0.tar.xz /src/
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install --no-install-recommends -y \
    bison \
    bzip2 \
    device-tree-compiler \
    flex \
    g++ \
    gnutls-dev \
    libcurl4-gnutls-dev \
    libfdt-dev \
    libglib2.0-dev \
    libncurses-dev \
    libslirp-dev \
    make \
    meson \
    ninja-build \
    python3-pip \
    uuid-dev \
    xz-utils \
    zlib1g-dev
RUN tar xf /src/qemu-10.2.0.tar.xz -C /src
ARG QEMU_TARGET_LIST=x86_64-softmmu,aarch64-softmmu,riscv64-softmmu,s390x-softmmu,ppc64-softmmu
ARG PREFIX=/usr/local
WORKDIR /tmp/build
RUN /src/qemu-*/configure \
    --without-default-features \
    --enable-attr \
    --enable-kvm \
    --enable-pie \
    --enable-slirp \
    --enable-strip \
    --enable-system \
    --enable-tcg \
    --enable-tools \
    --enable-tpm \
    --enable-vhost-crypto \
    --enable-vhost-kernel \
    --enable-vhost-net \
    --enable-vhost-user \
    --enable-virtfs \
    --prefix=$PREFIX \
    --target-list=$QEMU_TARGET_LIST
RUN make -j$(nproc) && make install
# RUN apt update && apt install --no-install-recommends -y upx
# RUN upx $PREFIX/bin/qemu-* $PREFIX/libexec/qemu-bridge-helper

FROM ubuntu:latest AS build-garden
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install --no-install-recommends -y \
    make \
    mypy \
    shfmt \
    python3 \
    shellcheck
ADD . /src/image-garden
WORKDIR /src/image-garden
RUN make --warn-undefined-variables && make check && make install --warn-undefined-variables

FROM ubuntu:latest
LABEL version="0.4"
LABEL maintainer="Zygmunt Krynicki <me@zygoon.pl>"
LABEL description="OCI container for running well-known system images in QEMU"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install --no-install-recommends -y \
    ca-certificates \
    curl \
    git \
    git-restore-mtime \
    libcurl3t64-gnutls \
    libfdt1 \
    libslirp0 \
    make \
    wget \
    whois \
    xorriso \
    xz-utils \
    && apt clean
ENV GARDEN_CACHE_DIR=/var/cache/image-garden
VOLUME /var/cache/image-garden
COPY --from=build-qemu /usr/local /usr/local
ENV GARDEN_X86_64_PREFIX=/usr/local
ENV GARDEN_AARCH64_PREFIX=/usr/local
ENV GARDEN_RISCV64_PREFIX=/usr/local
ENV GARDEN_S390X_PREFIX=/usr/local
ENV GARDEN_PPC64EL_PREFIX=/usr/local
COPY --from=build-garden /usr/local /usr/local
RUN rm -f /usr/local/share/doc/image-garden/NEWS.snappy*