-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
71 lines (55 loc) · 1.99 KB
/
Dockerfile
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
# syntax = docker/dockerfile:1.4
FROM public.ecr.aws/docker/library/fedora:40 as build
WORKDIR /work
RUN dnf update --best -y
# download and install cosign
RUN curl -L -O https://github.com/sigstore/cosign/releases/download/v2.2.4/cosign-2.2.4-1.x86_64.rpm && \
curl -L -O https://github.com/sigstore/cosign/releases/download/v2.2.4/cosign-2.2.4-1.x86_64.rpm-keyless.pem && \
curl -L -O https://github.com/sigstore/cosign/releases/download/v2.2.4/cosign-2.2.4-1.x86_64.rpm-keyless.sig && \
rpm -ivh cosign-2.2.4-1.x86_64.rpm
# use cosign to verify itself
RUN cosign verify-blob \
--certificate cosign-2.2.4-1.x86_64.rpm-keyless.pem \
--signature cosign-2.2.4-1.x86_64.rpm-keyless.sig \
--certificate-identity [email protected] \
--cert-oidc-issuer https://accounts.google.com \
cosign-2.2.4-1.x86_64.rpm
FROM public.ecr.aws/docker/library/fedora:40
WORKDIR /work
RUN dnf update --best -y
# install necessary cloud-server packages
RUN dnf group install -y cloud-server-environment --exclude=plymouth* \
--exclude=geolite* \
--exclude=firewalld* \
--exclude=grub* \
--exclude=dracut* \
--exclude=shim-*
# install packages needed by Lima
RUN dnf install -y \
--setopt=install_weak_deps=False \
qemu-user-static-aarch64 \
qemu-user-static-arm \
qemu-user-static-x86 \
iptables \
fuse-sshfs \
btrfs-progs
COPY --from=build /work/cosign-2.2.4-1.x86_64.rpm /work/cosign-2.2.4-1.x86_64.rpm
# install cosign
RUN rpm -ivh cosign-2.2.4-1.x86_64.rpm && \
rm -rf cosign-2.2.4-1.x86_64.rpm
RUN systemctl enable cloud-init cloud-init-local cloud-config cloud-final
# enable systemd
# disabled network conf in cloud config
RUN <<EOF cat >> /etc/wsl.conf
[boot]
systemd=true
EOF
RUN <<EOF cat >> /etc/cloud/cloud.cfg
network:
config: disabled
EOF
# cleanup
RUN dnf clean all && \
rm -f /etc/NetworkManager/system-connections/*.nmconnection && \
truncate -s 0 /etc/machine-id && \
rm -f /var/lib/systemd/random-seed