Skip to content

Commit

Permalink
disable network and use only ADD to get network things
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Deitcher <avi@deitcher.net>
  • Loading branch information
deitch committed Oct 18, 2022
1 parent fb6b2a9 commit 587b85e
Show file tree
Hide file tree
Showing 47 changed files with 318 additions and 204 deletions.
7 changes: 3 additions & 4 deletions pkg/acrn-kernel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM lfedge/eve-alpine:145f062a40639b6c65efa36bed1c5614b873be52 as kernel-build

ENV BUILD_PKGS \
argp-standalone automake bash bc binutils-dev bison build-base curl \
argp-standalone automake bash bc binutils-dev bison build-base \
diffutils flex git gmp-dev gnupg installkernel kmod openssl-dev \
linux-headers ncurses-dev python3 findutils sed squashfs-tools tar \
xz xz-dev zlib-dev openssl lz4 lz4-libs elfutils-libelf elfutils-dev
Expand All @@ -11,9 +11,8 @@ RUN eve-alpine-deploy.sh
# Download acrn-kernel
ENV KERNEL_VERSION acrn-2019w39.3-150000p
ENV KERNEL_SOURCE=https://github.com/projectacrn/acrn-kernel/archive/${KERNEL_VERSION}.tar.gz
RUN \
[ -f "$(basename ${KERNEL_SOURCE})" ] || curl -fsSLO "${KERNEL_SOURCE}" && \
tar --absolute-names -xz < "$(basename ${KERNEL_SOURCE})" && mv "/acrn-kernel-${KERNEL_VERSION}" /acrn-kernel
ADD ${KERNEL_SOURCE} /kernel.tar.gz
RUN tar --absolute-names -xz < /kernel.tar.gz && mv "/acrn-kernel-${KERNEL_VERSION}" /acrn-kernel
RUN ls -l /acrn-kernel

# Apply local patches
Expand Down
1 change: 0 additions & 1 deletion pkg/acrn-kernel/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
image: eve-acrn-kernel
org: lfedge
network: yes
7 changes: 3 additions & 4 deletions pkg/acrn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM lfedge/eve-alpine:145f062a40639b6c65efa36bed1c5614b873be52 AS kernel-build
ENV BUILD_PKGS \
gcc make libc-dev dev86 xz-dev perl bash python3-dev gettext iasl \
util-linux-dev ncurses-dev glib-dev pixman-dev libaio-dev yajl-dev \
argp-standalone linux-headers git patch texinfo curl tar bash socat \
argp-standalone linux-headers git patch texinfo tar bash socat \
openssh python3 libc-dev openssl-dev openssl libpciaccess libpciaccess-dev\
bsd-compat-headers libusb libusb-dev gnu-efi-dev py3-pip
RUN eve-alpine-deploy.sh
Expand All @@ -12,9 +12,8 @@ RUN pip3 install kconfiglib==12.14.1

ENV ACRN_VERSION 1.3
ENV ACRN_SOURCE=https://github.com/projectacrn/acrn-hypervisor/archive/v${ACRN_VERSION}.tar.gz
RUN \
[ -f "$(basename ${ACRN_SOURCE})" ] || curl -fsSLO "${ACRN_SOURCE}" && \
tar --absolute-names -xz < "$(basename ${ACRN_SOURCE})" && mv "/acrn-hypervisor-${ACRN_VERSION}" /acrn-hypervisor
ADD ${ACRN_SOURCE} /acrn.tar.gz
RUN tar --absolute-names -xz < /acrn.tar.gz && mv "/acrn-hypervisor-${ACRN_VERSION}" /acrn-hypervisor
RUN ls -l /acrn-hypervisor
# Apply local patches
COPY patches-${ACRN_VERSION} /patches
Expand Down
1 change: 0 additions & 1 deletion pkg/acrn/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
image: eve-acrn
org: lfedge
network: yes
6 changes: 4 additions & 2 deletions pkg/debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ RUN su builder -c 'cd /musl && abuild checksum && abuild -r'
RUN apk add -p /out --allow-untrusted /home/builder/packages/*/musl-1.2*.apk

# hadolint ignore=DL4006
RUN curl -L https://www.ezix.org/software/files/lshw-B.${LSHW_VERSION}.tar.gz | tar xzvf -
ADD https://www.ezix.org/software/files/lshw-B.${LSHW_VERSION}.tar.gz lshw.tar.gz
RUN tar -xzvf lshw.tar.gz

COPY lshw/ lshw-B.${LSHW_VERSION}/

Expand All @@ -42,7 +43,8 @@ RUN for patch in fix-musl-sc_long_bit.patch wrapper-for-basename.patch 155652295
# building hexedit
WORKDIR /tmp/hexedit/hexedit-1.5
# hadolint ignore=DL4006
RUN curl -L https://github.com/pixel/hexedit/archive/refs/tags/1.5.tar.gz | tar -C .. -xzvf -
ADD https://github.com/pixel/hexedit/archive/refs/tags/1.5.tar.gz ../1.5.tar.gz
RUN tar -C .. -xzvf ../1.5.tar.gz
RUN ./autogen.sh && ./configure && make DESTDIR=/out install

# tweaking various bit
Expand Down
1 change: 0 additions & 1 deletion pkg/debug/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
image: eve-debug
org: lfedge
network: yes
config:
pid: host
net: host
Expand Down
8 changes: 6 additions & 2 deletions pkg/dom0-ztools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ COPY /patches /
# * ZFS on Linux
ENV ZFS_VERSION=2.1.2
ENV ZFS_COMMIT=zfs-${ZFS_VERSION}
ENV ZFS_REPO=https://github.com/openzfs/zfs.git
ENV ZFS_REPO=https://github.com/openzfs/zfs
ENV ZFS_PATCH_DIR=/patches-zfs-"${ZFS_VERSION}"

WORKDIR /tmp/zfs

RUN git clone --depth 1 -b ${ZFS_COMMIT} ${ZFS_REPO} .
ADD ${ZFS_REPO}/tarball/${ZFS_COMMIT}/ zfs.tgz
RUN tar -zxvf zfs.tgz && \
mv openzfs-zfs-*/* . && \
rm -rf openzfs-zfs-* && \
rm zfs.tgz
RUN set -e; \
if [ ! -d "${ZFS_PATCH_DIR}" ]; then \
echo "No such dir ${ZFS_PATCH_DIR}"; \
Expand Down
1 change: 0 additions & 1 deletion pkg/dom0-ztools/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
org: lfedge
image: eve-dom0-ztools
network: yes
1 change: 0 additions & 1 deletion pkg/edgeview/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
image: eve-edgeview
org: lfedge
network: yes
config:
binds:
- /:/hostfs:ro
Expand Down
1 change: 0 additions & 1 deletion pkg/eve/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
image: eve
org: lfedge
network: yes
19 changes: 11 additions & 8 deletions pkg/fw/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
FROM lfedge/eve-alpine:145f062a40639b6c65efa36bed1c5614b873be52 as build

ENV BUILD_PKGS curl tar make
ENV BUILD_PKGS tar make
RUN eve-alpine-deploy.sh

ENV WIRELESS_REGDB_VERSION 2022.06.06
ENV WIRELESS_REGDB_REPO https://mirrors.edge.kernel.org/pub/software/network/wireless-regdb/wireless-regdb
ADD ${WIRELESS_REGDB_REPO}-${WIRELESS_REGDB_VERSION}.tar.gz /wireless-regdb.tar.gz
RUN mkdir /wireless-regdb &&\
curl -fsSL ${WIRELESS_REGDB_REPO}-${WIRELESS_REGDB_VERSION}.tar.gz | tar -xz --strip-components=1 -C /wireless-regdb &&\
tar -xz --strip-components=1 -C /wireless-regdb -f /wireless-regdb.tar.gz &&\
cp /wireless-regdb/regulatory.db /wireless-regdb/regulatory.db.p7s /lib/firmware

ENV LINUX_FIRMWARE_VERSION 20220708
ENV LINUX_FIRMWARE_URL https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware
ADD ${LINUX_FIRMWARE_URL}-${LINUX_FIRMWARE_VERSION}.tar.gz /linux-firmware.tar.gz
RUN mkdir /linux-firmware &&\
curl -fsSL ${LINUX_FIRMWARE_URL}-${LINUX_FIRMWARE_VERSION}.tar.gz | tar -xz --strip-components=1 -C /linux-firmware &&\
tar -xz --strip-components=1 -C /linux-firmware -f /linux-firmware.tar.gz &&\
make -C /linux-firmware FIRMWAREDIR="/lib/firmware" install

# patch merged, but not released, remove this when update LINUX_FIRMWARE_VERSION
Expand All @@ -30,18 +32,19 @@ RUN ln -s ../cypress/cyfmac43430-sdio.bin /lib/firmware/brcm/brcmfmac43430-sdio.

ENV RPI_FIRMWARE_VERSION 2c8f665254899a52260788dd902083bb57a99738
ENV RPI_FIRMWARE_URL https://github.com/RPi-Distro/firmware-nonfree/archive
ADD ${RPI_FIRMWARE_URL}/${RPI_FIRMWARE_VERSION}.tar.gz /rpifirmware.tar.gz
RUN mkdir /rpi-firmware &&\
curl -fsSL ${RPI_FIRMWARE_URL}/${RPI_FIRMWARE_VERSION}.tar.gz | tar -xz --strip-components=1 -C /rpi-firmware &&\
tar -xz --strip-components=1 -C /rpi-firmware -f /rpifirmware.tar.gz &&\
cp -a /rpi-firmware/debian/config/brcm80211/brcm/brcmfmac43436* /lib/firmware/brcm

ENV RPI_BT_FIRMWARE_VERSION e7fd166981ab4bb9a36c2d1500205a078a35714d
ENV RPI_BT_FIRMWARE_URL https://github.com/RPi-Distro/bluez-firmware/raw

WORKDIR /lib/firmware/brcm
RUN curl -fsSL ${RPI_BT_FIRMWARE_URL}/${RPI_BT_FIRMWARE_VERSION}/broadcom/BCM43430A1.hcd -O &&\
curl -fsSL ${RPI_BT_FIRMWARE_URL}/${RPI_BT_FIRMWARE_VERSION}/broadcom/BCM4345C0.hcd -O &&\
curl -fsSL ${RPI_BT_FIRMWARE_URL}/${RPI_BT_FIRMWARE_VERSION}/broadcom/BCM43430B0.hcd -O &&\
curl -fsSL ${RPI_BT_FIRMWARE_URL}/${RPI_BT_FIRMWARE_VERSION}/broadcom/BCM4345C5.hcd -O
ADD ${RPI_BT_FIRMWARE_URL}/${RPI_BT_FIRMWARE_VERSION}/broadcom/BCM43430A1.hcd .
ADD ${RPI_BT_FIRMWARE_URL}/${RPI_BT_FIRMWARE_VERSION}/broadcom/BCM4345C0.hcd .
ADD ${RPI_BT_FIRMWARE_URL}/${RPI_BT_FIRMWARE_VERSION}/broadcom/BCM43430B0.hcd .
ADD ${RPI_BT_FIRMWARE_URL}/${RPI_BT_FIRMWARE_VERSION}/broadcom/BCM4345C5.hcd .

FROM lfedge/eve-alpine:145f062a40639b6c65efa36bed1c5614b873be52 as compactor
ENTRYPOINT []
Expand Down
1 change: 0 additions & 1 deletion pkg/fw/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
image: eve-fw
org: lfedge
network: yes
80 changes: 46 additions & 34 deletions pkg/grub/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM lfedge/eve-alpine:145f062a40639b6c65efa36bed1c5614b873be52 as grub-build
FROM lfedge/eve-alpine:145f062a40639b6c65efa36bed1c5614b873be52 as grub-build-base
ENV BUILD_PKGS automake \
make \
bison \
Expand All @@ -23,58 +23,70 @@ RUN eve-alpine-deploy.sh
ENV GRUB_MODULES_PORT="part_gpt fat ext2 iso9660 squash4 gzio linux acpi normal cpio crypto disk boot crc64 \
search_disk_uuid search_part_label search_label xzio xfs video gfxterm serial gptprio chain probe reboot regexp smbios \
part_msdos cat echo test configfile loopback"
ENV GRUB_MODULES_i386_pc="multiboot multiboot2 biosdisk gpt verify"
ENV GRUB_MODULES_x86_64="multiboot multiboot2 efi_uga efi_gop linuxefi gpt verify gcry_sha256 measurefs"
ENV GRUB_MODULES_aarch64="xen_boot efi_gop gpt"
ENV GRUB_MODULES_riscv64=""

FROM grub-build-base AS grub-build-amd64
ENV GRUB_MODULES="multiboot multiboot2 efi_uga efi_gop linuxefi gpt verify gcry_sha256 measurefs"
ENV GRUB_COMMIT=71f9e4ac44142af52c3fc1860436cf9e432bf764
ENV GRUB_TAG_riscv64=2.06
ENV GRUB_TAG_aarch64=2.06
ENV GRUB_PATCHES=patches
# colon separator because one of the platforms requires a space in it
ENV GRUB_PLATFORM="efi:pc --disable-efiemu"

FROM grub-build-base AS grub-build-arm64
ENV GRUB_MODULES="xen_boot efi_gop gpt"
ENV GRUB_COMMIT=2.06
ENV GRUB_PATCHES="patches-${GRUB_COMMIT} patches-aarch64-${GRUB_COMMIT}"
ENV GRUB_PLATFORM=efi

ENV GRUB_REPO=https://git.savannah.gnu.org/git/grub.git
FROM grub-build-base AS grub-build-riscv64
ENV GRUB_MODULES=""
ENV GRUB_COMMIT=2.06
ENV GRUB_PATCHES="patches-${GRUB_COMMIT} patches-riscv64-${GRUB_COMMIT}"
ENV GRUB_PLATFORM=efi

FROM grub-build-base AS grub-build-i386
ENV GRUB_MODULES="multiboot multiboot2 biosdisk gpt verify"
ENV GRUB_COMMIT=71f9e4ac44142af52c3fc1860436cf9e432bf764
ENV GRUB_PATCHES="patches-${GRUB_COMMIT}"
ENV GRUB_PLATFORM=efi

FROM grub-build-${TARGETARCH} AS grub-build

ENV GRUB_REPO=https://git.savannah.gnu.org/cgit/grub.git/snapshot/grub-${GRUB_COMMIT}.tar.gz

COPY / /
# because python is not available
RUN ln -s python3 /usr/bin/python && \
mkdir /grub-lib

ADD ${GRUB_REPO}/snapshot/grub-${GRUB_COMMIT}.tar.gz /grub.tar.gz

# hadolint ignore=DL3003
RUN if [ ! -d "grub" ]; then \
git clone ${GRUB_REPO} \
&& cd /grub \
&& git config --add user.email a@b.c \
&& git config user.name a \
&& if [ "$(uname -m)" != x86_64 ]; then \
GRUB_COMMIT="$(git show-ref -s tags/grub-"$(eval echo "\$GRUB_TAG_$(uname -m)")")"; \
fi \
&& git checkout -b grub-build "$GRUB_COMMIT" \
&& if [ "$(uname -m)" != x86_64 ]; then \
rm -rf /patches \
&& mv /patches-"$(eval echo "\$GRUB_TAG_$(uname -m)")" /patches \
&& cp /patches-"$(uname -m)"-"$(eval echo "\$GRUB_TAG_$(uname -m)")"/* /patches/; \
fi \
&& git am /patches/* \
&& (./bootstrap || ./autogen.sh) ; \
tar -xzf /grub.tar.gz; \
mv "grub-${GRUB_COMMIT}" grub; \
rm -f /grub.tar.gz; \
mkdir -p /apply/patches; \
for dir in "${GRUB_PATCHES}"; do \
cp -r /${dir}/* /apply/patches; \
done; \
git am /patches/*; \
(./bootstrap || ./autogen.sh) ; \
fi


WORKDIR /grub

ENV BUILD_GRUB="set -e && \
if [ -f Makefile ]; then make distclean; fi && \
./configure --disable-werror --libdir=/grub-lib --with-platform=\${GRUB_PLATFORM} CFLAGS='-Os -Wno-unused-value' && \
make -j $(getconf _NPROCESSORS_ONLN) && \
make install"

ENV GRUB_PLATFORM=efi
RUN eval $BUILD_GRUB
RUN if [ "$(uname -m)" = x86_64 ]; then GRUB_PLATFORM="pc --disable-efiemu" && eval "$BUILD_GRUB" ; fi

RUN set -e; IFS=:; for p in "${GRUB_PLATFORM}"; do \
[ -f Makefile ] && make distclean; \
./configure --disable-werror --libdir=/grub-lib --with-platform=${p} CFLAGS='-Os -Wno-unused-value'; \
make -j $(getconf _NPROCESSORS_ONLN); \
make install; \
done

COPY embedded.cfg /

# create the grub core image
RUN case $(uname -m) in \
RUN case "$(uname -m)" in \
x86_64) \
./grub-mkimage -O x86_64-efi -d /grub-lib/grub/x86_64-efi -o /grub-lib/BOOTX64.EFI -p /EFI/BOOT ${GRUB_MODULES_PORT} ${GRUB_MODULES_x86_64} &&\
./grub-mkimage -O i386-pc -d /grub-lib/grub/i386-pc -o /grub-lib/BOOT.pc -p /EFI/BOOT -c /embedded.cfg ${GRUB_MODULES_PORT} ${GRUB_MODULES_i386_pc} && \
Expand Down
1 change: 0 additions & 1 deletion pkg/grub/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
org: lfedge
image: eve-grub
network: true
1 change: 0 additions & 1 deletion pkg/guacd/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
image: eve-guacd
org: lfedge
network: yes
config:
binds:
- /dev:/dev
Expand Down
8 changes: 6 additions & 2 deletions pkg/ipxe/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM lfedge/eve-alpine:145f062a40639b6c65efa36bed1c5614b873be52 AS build

ENV BUILD_PKGS patch curl make gcc perl util-linux-dev git mtools linux-headers musl-dev xz-dev
ENV BUILD_PKGS patch make gcc perl util-linux-dev git mtools linux-headers musl-dev xz-dev
# bash xorriso coreutils syslinux
RUN eve-alpine-deploy.sh

WORKDIR /ws
RUN git clone --depth 1 -b v1.21.1 https://github.com/ipxe/ipxe.git .
ADD https://github.com/ipxe/ipxe/tarball/v1.21.1 /ipxe.tgz
RUN tar -zxvf /ipxe.tgz && \
mv ipxe-ipxe-*/* . && \
rm -rf ipxe-ipxe-* && \
rm /ipxe.tgz

COPY embedded.cfg src/embedded.cfg
COPY *patch /tmp/
Expand Down
1 change: 0 additions & 1 deletion pkg/ipxe/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
image: eve-ipxe
org: lfedge
network: yes
8 changes: 6 additions & 2 deletions pkg/k3s/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM lfedge/eve-alpine:145f062a40639b6c65efa36bed1c5614b873be52 as build
ENV BUILD_PKGS make gcc git musl-dev linux-headers curl bash pkgconf libseccomp-dev go patch
ENV BUILD_PKGS make gcc git musl-dev linux-headers bash pkgconf libseccomp-dev go patch
RUN eve-alpine-deploy.sh

ARG K3SVER=v1.18.4+k3s1

WORKDIR /k3s
COPY 0001-go-mod.patch /tmp/
RUN git clone -b ${K3SVER} --depth 1 https://github.com/rancher/k3s.git .
ADD https://github.com/rancher/k3s/tarball/${K3SVER} /tmp/k3s.tgz
RUN tar -zxvf /tmp/k3s.tgz && \
mv rancher-k3s-*/* . && \
rm -rf rancher-k3s-* && \
rm /tmp/k3s.tgz
RUN patch -p1 < /tmp/0001-go-mod.patch
RUN scripts/download
RUN scripts/build
Expand Down
1 change: 0 additions & 1 deletion pkg/k3s/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
image: eve-k3s
org: lfedge
network: yes
Loading

0 comments on commit 587b85e

Please sign in to comment.