build(Linux): Refactor Dockerfiles and build script for multi-stage, step-based builds (#4299)
This commit is contained in:
@@ -17,26 +17,11 @@ pacman -Syu --disable-download-timeout --noconfirm
|
||||
pacman -Scc --noconfirm
|
||||
_DEPS
|
||||
|
||||
FROM sunshine-base AS sunshine-build
|
||||
|
||||
ARG BRANCH
|
||||
ARG BUILD_VERSION
|
||||
ARG COMMIT
|
||||
ARG CLONE_URL
|
||||
# note: BUILD_VERSION may be blank
|
||||
|
||||
ENV BRANCH=${BRANCH}
|
||||
ENV BUILD_VERSION=${BUILD_VERSION}
|
||||
ENV COMMIT=${COMMIT}
|
||||
ENV CLONE_URL=${CLONE_URL}
|
||||
|
||||
# PKGBUILD options
|
||||
ENV _use_cuda=true
|
||||
ENV _run_unit_tests=true
|
||||
ENV _support_headless_testing=true
|
||||
FROM sunshine-base AS sunshine-deps
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Install dependencies first - this layer will be cached
|
||||
RUN <<_SETUP
|
||||
#!/bin/bash
|
||||
set -e
|
||||
@@ -60,6 +45,26 @@ pacman -Syu --disable-download-timeout --needed --noconfirm \
|
||||
pacman -Scc --noconfirm
|
||||
_SETUP
|
||||
|
||||
FROM sunshine-deps AS sunshine-build
|
||||
|
||||
ARG BRANCH
|
||||
ARG BUILD_VERSION
|
||||
ARG COMMIT
|
||||
ARG CLONE_URL
|
||||
# note: BUILD_VERSION may be blank
|
||||
|
||||
ENV BRANCH=${BRANCH}
|
||||
ENV BUILD_VERSION=${BUILD_VERSION}
|
||||
ENV COMMIT=${COMMIT}
|
||||
ENV CLONE_URL=${CLONE_URL}
|
||||
|
||||
# PKGBUILD options
|
||||
ENV _use_cuda=true
|
||||
ENV _run_unit_tests=true
|
||||
ENV _support_headless_testing=true
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Setup builder user
|
||||
USER builder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user