2022-08-16 08:47:21 +02:00
|
|
|
# syntax=docker/dockerfile:1.3
|
2024-01-07 07:32:32 +01:00
|
|
|
ARG UBUNTU_RELEASE=23.10
|
2023-08-23 20:21:48 +02:00
|
|
|
ARG USER=ubuntu UID=101 GROUP=ubuntu GID=101
|
|
|
|
|
|
|
|
### BOILERPLATE BEGIN ###
|
|
|
|
|
|
|
|
FROM golang:1.20 AS chisel
|
|
|
|
ARG UBUNTU_RELEASE
|
|
|
|
RUN git clone -b ubuntu-${UBUNTU_RELEASE} https://github.com/canonical/chisel-releases /opt/chisel-releases \
|
|
|
|
&& git clone --depth 1 -b main https://github.com/canonical/chisel /opt/chisel
|
|
|
|
WORKDIR /opt/chisel
|
|
|
|
RUN go generate internal/deb/version.go \
|
|
|
|
&& go build ./cmd/chisel
|
|
|
|
|
|
|
|
FROM ubuntu:$UBUNTU_RELEASE AS builder
|
|
|
|
SHELL ["/bin/bash", "-oeux", "pipefail", "-c"]
|
|
|
|
RUN apt-get update \
|
|
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates \
|
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=chisel /opt/chisel/chisel /usr/bin/
|
|
|
|
|
|
|
|
FROM builder AS rootfs-prep
|
|
|
|
ARG USER UID GROUP GID
|
|
|
|
RUN mkdir -p /rootfs/etc \
|
|
|
|
&& echo "$GROUP:x:$GID:" >/rootfs/etc/group \
|
|
|
|
&& echo "$USER:x:$UID:$GID::/nohome:/noshell" >/rootfs/etc/passwd
|
|
|
|
|
|
|
|
FROM scratch AS image-prep
|
|
|
|
ARG UID GID
|
|
|
|
USER $UID:$GID
|
|
|
|
|
|
|
|
### BOILERPLATE END ###
|
|
|
|
|
|
|
|
FROM ubuntu:$UBUNTU_RELEASE AS build
|
2022-08-16 08:47:21 +02:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG USE_CCACHE
|
2023-08-23 20:21:48 +02:00
|
|
|
RUN apt-get update && apt-get -y full-upgrade && \
|
2023-01-08 08:35:03 +01:00
|
|
|
apt-get install -y build-essential wget git ccache ninja-build libssl-dev pkg-config libarchive-tools \
|
2023-08-23 20:21:48 +02:00
|
|
|
cmake cmake-data
|
2022-08-16 08:47:21 +02:00
|
|
|
COPY . /root/build-files
|
|
|
|
|
|
|
|
RUN --mount=type=cache,id=ccache,target=/root/.ccache \
|
2022-09-13 02:53:49 +02:00
|
|
|
git clone --depth 1000 -j4 --recursive https://github.com/yuzu-emu/yuzu-mainline.git /root/yuzu-mainline && \
|
2022-08-16 08:47:21 +02:00
|
|
|
cd /root/yuzu-mainline && /root/build-files/.ci/build.sh
|
|
|
|
|
2023-08-23 20:21:48 +02:00
|
|
|
FROM rootfs-prep AS sliced-deps
|
|
|
|
COPY --from=chisel /opt/chisel-releases /opt/chisel-releases
|
|
|
|
RUN chisel cut --release /opt/chisel-releases --root /rootfs \
|
|
|
|
base-files_base \
|
|
|
|
base-files_release-info \
|
|
|
|
ca-certificates_data \
|
|
|
|
libgcc-s1_libs \
|
|
|
|
libc6_libs \
|
|
|
|
libssl3_libs \
|
|
|
|
libstdc++6_libs \
|
2023-09-07 04:21:27 +02:00
|
|
|
openssl_config \
|
|
|
|
openssl_data
|
2023-08-23 20:21:48 +02:00
|
|
|
|
|
|
|
FROM image-prep AS final
|
|
|
|
COPY --from=sliced-deps /rootfs /
|
2022-08-16 08:47:21 +02:00
|
|
|
LABEL maintainer="yuzuemu"
|
|
|
|
# Create app directory
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY --from=build /root/yuzu-mainline/build/bin/yuzu-room /usr/src/app
|
|
|
|
ENTRYPOINT [ "/usr/src/app/yuzu-room" ]
|