Facebook
From Sweet Pelican, 6 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 72
  1. # BASE STAGE: Minimal install for what is required for the SDK to run
  2. FROM ubuntu:20.04 AS base
  3.  
  4. ARG DEBIAN_FRONTEND=noninteractive
  5.  
  6. # Install needed applications for running the SDK
  7. RUN apt-get update && \
  8.     apt-get install -y --no-install-recommends \
  9.       build-essential=12.8ubuntu1 \
  10.       clang=1:10.0-50~exp1 \
  11.       libicu66=66.1-2ubuntu2 \
  12.       lld=1:10.0-50~exp1 && \
  13.     rm -rf /var/lib/apt/lists/*
  14.  
  15. # SETUP STAGE: Minimal install for what is required to download/setup the SDK
  16. FROM ubuntu:20.04 as setup
  17.  
  18. # Install needed applications for downloading/setting up the SDK
  19. RUN apt-get update && \
  20.     apt-get install -y --no-install-recommends \
  21. #      ca-certificates=20190110ubuntu1.1 \
  22. #      curl=7.68.0-1ubuntu2.2 \
  23.       tar=1.30+dfsg-7
  24. RUN apt-get -y install wget && \
  25.       rm -rf /var/lib/apt/lists/*
  26.  
  27. # Set the OO_PS4_TOOLCHAIN environmental variable for later use vs using copy/paste
  28. ENV OO_PS4_TOOLCHAIN=/lib/OpenOrbisSDK
  29.  
  30. # Set repo and version from CLI input
  31. ARG GITHUB_REPOSITORY
  32. ARG OO_TOOLCHAIN_VERSION
  33. ENV GITHUB_REPOSITORY=OpenOrbis-PS4-Toolchain
  34. ENV OO_TOOLCHAIN_VERSION=v0.5.1
  35.  
  36. # Download the latest Linux release and extract to the $OO_PS4_TOOLCHAIN directory
  37. SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  38. RUN mkdir -p $OO_PS4_TOOLCHAIN/ && \
  39.     wget https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/releases/download/v0.5.1/v0.5.1.tar.gz  
  40. #-sL https://github.com/$GITHUB_REPOSITORY/releases/download/$OO_TOOLCHAIN_VERSION/$OO_TOOLCHAIN_VERSION.tar.gz | \
  41. RUN    tar -xzf v0.5.1.tar.gz -C $OO_PS4_TOOLCHAIN/
  42.  
  43. # RUNTIME STAGE: The final stage where the magic happens
  44. FROM base as runtime
  45.  
  46. # Set the environmental variables for the SDK location
  47. ENV OO_PS4_TOOLCHAIN=/lib/OpenOrbisSDK
  48. ENV PATH=$OO_PS4_TOOLCHAIN:$OO_PS4_TOOLCHAIN/bin/linux:$PATH
  49.  
  50. # Set version from CLI input
  51. ARG OO_TOOLCHAIN_VERSION
  52. ENV OO_TOOLCHAIN_VERSION=$OO_TOOLCHAIN_VERSION
  53.  
  54. # Copy the SDK from the setup stage to this stage
  55. COPY --from=setup ${OO_PS4_TOOLCHAIN} ${OO_PS4_TOOLCHAIN}