build(docker): update dockerfiles (#3085)
This commit is contained in:
parent
6593fa5d61
commit
ddd67ce01d
7 changed files with 48 additions and 49 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# syntax=docker/dockerfile:1.4
|
||||
# syntax=docker/dockerfile:1
|
||||
# artifacts: true
|
||||
# platforms: linux/amd64
|
||||
# archlinux does not have an arm64 base image
|
||||
|
|
@ -17,7 +17,7 @@ pacman -Syu --disable-download-timeout --noconfirm
|
|||
pacman -Scc --noconfirm
|
||||
_DEPS
|
||||
|
||||
FROM sunshine-base as sunshine-build
|
||||
FROM sunshine-base AS sunshine-build
|
||||
|
||||
ARG BRANCH
|
||||
ARG BUILD_VERSION
|
||||
|
|
@ -31,18 +31,19 @@ ENV COMMIT=${COMMIT}
|
|||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Setup builder user, arch prevents running makepkg as root
|
||||
RUN useradd -m builder && \
|
||||
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# patch the build flags
|
||||
# hadolint ignore=SC2016
|
||||
RUN sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
|
||||
|
||||
# install dependencies
|
||||
RUN <<_DEPS
|
||||
RUN <<_SETUP
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Setup builder user, arch prevents running makepkg as root
|
||||
useradd -m builder
|
||||
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# patch the build flags
|
||||
sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
|
||||
|
||||
# install dependencies
|
||||
pacman -Syu --disable-download-timeout --needed --noconfirm \
|
||||
base-devel \
|
||||
cmake \
|
||||
|
|
@ -51,7 +52,7 @@ pacman -Syu --disable-download-timeout --needed --noconfirm \
|
|||
namcap \
|
||||
xorg-server-xvfb
|
||||
pacman -Scc --noconfirm
|
||||
_DEPS
|
||||
_SETUP
|
||||
|
||||
# Setup builder user
|
||||
USER builder
|
||||
|
|
@ -84,9 +85,11 @@ cmake \
|
|||
_MAKE
|
||||
|
||||
WORKDIR /build/sunshine/pkg
|
||||
RUN mv /build/sunshine/build/PKGBUILD .
|
||||
RUN mv /build/sunshine/build/sunshine.install .
|
||||
RUN makepkg --printsrcinfo > .SRCINFO
|
||||
RUN <<_PACKAGE
|
||||
mv /build/sunshine/build/PKGBUILD .
|
||||
mv /build/sunshine/build/sunshine.install .
|
||||
makepkg --printsrcinfo > .SRCINFO
|
||||
_PACKAGE
|
||||
|
||||
# create a PKGBUILD archive
|
||||
USER root
|
||||
|
|
@ -111,12 +114,12 @@ rm -f /build/sunshine/pkg/sunshine-debug*.pkg.tar.zst
|
|||
ls -a
|
||||
_PKGBUILD
|
||||
|
||||
FROM scratch as artifacts
|
||||
FROM scratch AS artifacts
|
||||
|
||||
COPY --link --from=sunshine-build /build/sunshine/pkg/sunshine*.pkg.tar.zst /sunshine.pkg.tar.zst
|
||||
COPY --link --from=sunshine-build /build/sunshine/sunshine.pkg.tar.gz /sunshine.pkg.tar.gz
|
||||
|
||||
FROM sunshine-base as sunshine
|
||||
FROM sunshine-base AS sunshine
|
||||
|
||||
COPY --link --from=artifacts /sunshine.pkg.tar.zst /
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue