forked from ibuildthecloud/os2
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathDockerfile
54 lines (38 loc) · 1.81 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
# syntax=docker/dockerfile:1.7.0
FROM registry.opensuse.org/isv/rancher/harvester/os/dev/main/baseos:latest AS base
ARG CACHEBUST
# elemental init first
RUN elemental init --force
# Create the folder for journald persistent data
RUN mkdir -p /var/log/journal
# Create necessary cloudconfig folders so that elemental cli won't show warnings during installation
RUN mkdir -p /usr/local/cloud-config
RUN mkdir -p /oem
# Enable /tmp to be on tmpfs
RUN cp /usr/share/systemd/tmp.mount /etc/systemd/system
COPY files/ /
# remove unused 05_network.yaml
RUN rm -f /system/oem/05_network.yaml
# Append more options
COPY os-release /tmp
RUN cat /tmp/os-release >> /usr/lib/os-release && rm -f /tmp/os-release
# Remove /etc/cos/config to use default values
RUN rm -f /etc/cos/config
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/arm64" ]; then \
echo "Error: Unsupported TARGETPLATFORM: $TARGETPLATFORM" && \
exit 1; \
fi
ENV ARCH=${TARGETPLATFORM#linux/}
# Download rancherd
ARG RANCHERD_VERSION=v0.4.0-rc1
RUN curl -o /usr/bin/rancherd -sfL "https://github.com/rancher/rancherd/releases/download/${RANCHERD_VERSION}/rancherd-${ARCH}" && chmod 0755 /usr/bin/rancherd
# Download nerdctl
ARG NERDCTL_VERSION=1.2.1
RUN curl -o ./nerdctl-bin.tar.gz -sfL "https://github.com/containerd/nerdctl/releases/download/v${NERDCTL_VERSION}/nerdctl-${NERDCTL_VERSION}-linux-${ARCH}.tar.gz"
RUN tar -zxvf nerdctl-bin.tar.gz && mv nerdctl /usr/bin/
RUN rm -f nerdctl-bin.tar.gz containerd-rootless-setuptool.sh containerd-rootless.sh
# Remove files that need to be unique on each host.
# These will be generated automatically at runtime.
# See https://github.com/harvester/harvester/issues/6911 for details
RUN rm -f /etc/machine-id /etc/iscsi/initiatorname.iscsi /etc/nvme/hostid /etc/nvme/hostnqn