mirror of
https://github.com/VSCodium/vscode-linux-build-agent.git
synced 2025-12-13 04:44:17 -06:00
Merge remote-tracking branch 'microsoft/main'
This commit is contained in:
commit
fc8eabbdbf
5
SECURITY.md
Normal file
5
SECURITY.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
## Security
|
||||||
|
|
||||||
|
## Preferred Languages
|
||||||
|
|
||||||
|
We prefer all communications to be in English.
|
||||||
@ -1,6 +1,9 @@
|
|||||||
FROM arm64v8/node:14.16.0-alpine
|
ARG REPO=alpine
|
||||||
|
ARG TAG=3.16
|
||||||
|
FROM arm64v8/${REPO}:${TAG}
|
||||||
|
|
||||||
RUN apk add g++ python make git bash curl perl pkgconfig libsecret-dev && uname -m
|
RUN apk add nodejs npm g++ python3 make git bash curl perl pkgconfig libsecret-dev krb5-dev
|
||||||
|
RUN npm install -g yarn
|
||||||
|
|
||||||
RUN mkdir -p /root/vscode
|
RUN mkdir -p /root/vscode
|
||||||
WORKDIR /root/vscode
|
WORKDIR /root/vscode
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
ARG REPO=node
|
ARG REPO=alpine
|
||||||
ARG TAG=14.16.0-alpine
|
ARG TAG=3.16
|
||||||
FROM ${REPO}:${TAG}
|
FROM ${REPO}:${TAG}
|
||||||
|
|
||||||
RUN apk add g++ python make git bash curl perl pkgconfig libsecret-dev
|
RUN apk add nodejs npm g++ python3 make git bash curl perl pkgconfig libsecret-dev krb5-dev
|
||||||
|
RUN npm install -g yarn
|
||||||
|
|
||||||
RUN mkdir -p /root/vscode
|
RUN mkdir -p /root/vscode
|
||||||
WORKDIR /root/vscode
|
WORKDIR /root/vscode
|
||||||
@ -16,7 +16,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libx11-xcb-dev:arm64 \
|
libx11-xcb-dev:arm64 \
|
||||||
libxkbfile-dev:arm64 \
|
libxkbfile-dev:arm64 \
|
||||||
libsecret-1-dev:arm64 \
|
libsecret-1-dev:arm64 \
|
||||||
libkrb5-dev:arm64 \
|
|
||||||
curl \
|
curl \
|
||||||
gnupg \
|
gnupg \
|
||||||
unzip \
|
unzip \
|
||||||
@ -31,9 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libc6-dev \
|
libc6-dev \
|
||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
zlib1g-dev \
|
zlib1g-dev
|
||||||
# VSCodium
|
|
||||||
jq
|
|
||||||
|
|
||||||
# Compile python3.9 from source
|
# Compile python3.9 from source
|
||||||
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
|
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
|
||||||
@ -16,7 +16,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libx11-xcb-dev:armhf \
|
libx11-xcb-dev:armhf \
|
||||||
libxkbfile-dev:armhf \
|
libxkbfile-dev:armhf \
|
||||||
libsecret-1-dev:armhf \
|
libsecret-1-dev:armhf \
|
||||||
libkrb5-dev:armhf \
|
|
||||||
curl \
|
curl \
|
||||||
gnupg \
|
gnupg \
|
||||||
unzip \
|
unzip \
|
||||||
@ -31,9 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libc6-dev \
|
libc6-dev \
|
||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
zlib1g-dev \
|
zlib1g-dev
|
||||||
# VSCodium
|
|
||||||
jq
|
|
||||||
|
|
||||||
# Compile python3.9 from source
|
# Compile python3.9 from source
|
||||||
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
|
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
|
||||||
86
archived/focal-x64/Dockerfile_Unused
Normal file
86
archived/focal-x64/Dockerfile_Unused
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
|
||||||
|
ARG TAG=20.04
|
||||||
|
FROM ${REPO}:${TAG}
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN groupadd --gid 1000 builduser \
|
||||||
|
&& useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser \
|
||||||
|
&& mkdir -p /setup
|
||||||
|
|
||||||
|
# Set up TEMP directory
|
||||||
|
ENV TEMP=/tmp
|
||||||
|
RUN chmod a+rwx /tmp
|
||||||
|
|
||||||
|
# Latest stable git
|
||||||
|
RUN apt-get update && apt-get install -y software-properties-common
|
||||||
|
RUN add-apt-repository ppa:git-core/ppa -y
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
gnome-keyring \
|
||||||
|
iproute2 \
|
||||||
|
libfuse2 \
|
||||||
|
libgconf-2-4 \
|
||||||
|
libgdk-pixbuf2.0-0 \
|
||||||
|
libgl1 \
|
||||||
|
libgtk-3.0 \
|
||||||
|
libsecret-1-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libx11-dev \
|
||||||
|
libx11-xcb-dev \
|
||||||
|
libxkbfile-dev \
|
||||||
|
locales \
|
||||||
|
lsb-release \
|
||||||
|
lsof \
|
||||||
|
python-dbus \
|
||||||
|
python3-pip \
|
||||||
|
sudo \
|
||||||
|
wget \
|
||||||
|
xvfb \
|
||||||
|
tzdata \
|
||||||
|
unzip \
|
||||||
|
&& curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.sh\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.sh \
|
||||||
|
&& curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.py\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.py \
|
||||||
|
# Remove snapcraft to avoid issues on docker build
|
||||||
|
&& sed -i 's/packages.append("snapcraft")/#packages.append("snapcraft")/g' /setup/install-build-deps.py \
|
||||||
|
&& chmod +x /setup/install-build-deps.sh \
|
||||||
|
&& chmod +x /setup/install-build-deps.py \
|
||||||
|
&& bash /setup/install-build-deps.sh --no-syms --no-prompt --no-chromeos-fonts --no-arm --no-nacl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Yarn
|
||||||
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||||
|
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
RUN apt-get update && apt-get install -y yarn
|
||||||
|
|
||||||
|
# No Sudo Prompt
|
||||||
|
RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \
|
||||||
|
&& echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
|
||||||
|
|
||||||
|
# Dotnet
|
||||||
|
RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
|
||||||
|
RUN dpkg -i packages-microsoft-prod.deb
|
||||||
|
RUN apt-get update && apt-get install -y dotnet-sdk-2.1
|
||||||
|
|
||||||
|
# Set python3 as default
|
||||||
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
||||||
|
RUN python --version
|
||||||
|
|
||||||
|
# Add xvfb init script
|
||||||
|
COPY xvfb-init.sh /etc/init.d/xvfb
|
||||||
|
RUN chmod a+x /etc/init.d/xvfb
|
||||||
|
|
||||||
|
# Setup dbus path
|
||||||
|
RUN sudo mkdir -p /var/run/dbus
|
||||||
|
|
||||||
|
# Check compiler toolchain
|
||||||
|
RUN gcc --version
|
||||||
|
RUN g++ --version
|
||||||
|
|
||||||
|
USER builduser
|
||||||
|
WORKDIR /home/builduser
|
||||||
3
archived/focal-x64/xvfb-init.sh
Executable file
3
archived/focal-x64/xvfb-init.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
XVFB=/usr/bin/Xvfb
|
||||||
|
XVFBARGS=":10 -ac -screen 0 1280x800x24 -nolisten tcp -dpi 96 +extension RANDR"
|
||||||
|
/sbin/start-stop-daemon --start --quiet --background --exec $XVFB -- $XVFBARGS
|
||||||
@ -1,54 +0,0 @@
|
|||||||
ARG RISK=stable
|
|
||||||
ARG UBUNTU=18.04
|
|
||||||
|
|
||||||
FROM ubuntu:$UBUNTU as builder
|
|
||||||
ARG RISK
|
|
||||||
ARG UBUNTU
|
|
||||||
RUN echo "Building snapcraft:$RISK in ubuntu:$UBUNTU"
|
|
||||||
|
|
||||||
# Grab dependencies
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get dist-upgrade --yes
|
|
||||||
RUN apt-get install --yes \
|
|
||||||
curl \
|
|
||||||
jq \
|
|
||||||
squashfs-tools
|
|
||||||
|
|
||||||
# Grab the core18 snap (which snapcraft uses as a base) from the stable channel
|
|
||||||
# and unpack it in the proper place.
|
|
||||||
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core18' | jq '.download_url' -r) --output core18.snap
|
|
||||||
RUN mkdir -p /snap/core18
|
|
||||||
RUN unsquashfs -d /snap/core18/current core18.snap
|
|
||||||
|
|
||||||
# Grab the snapcraft snap from the $RISK channel and unpack it in the proper
|
|
||||||
# place.
|
|
||||||
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel='$RISK | jq '.download_url' -r) --output snapcraft.snap
|
|
||||||
RUN mkdir -p /snap/snapcraft
|
|
||||||
RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap
|
|
||||||
|
|
||||||
# Create a snapcraft runner (TODO: move version detection to the core of
|
|
||||||
# snapcraft).
|
|
||||||
RUN mkdir -p /snap/bin
|
|
||||||
RUN echo "#!/bin/sh" > /snap/bin/snapcraft
|
|
||||||
RUN snap_version="$(awk '/^version:/{print $2}' /snap/snapcraft/current/meta/snap.yaml)" && echo "export SNAP_VERSION=\"$snap_version\"" >> /snap/bin/snapcraft
|
|
||||||
RUN echo 'exec "$SNAP/usr/bin/python3" "$SNAP/bin/snapcraft" "$@"' >> /snap/bin/snapcraft
|
|
||||||
RUN chmod +x /snap/bin/snapcraft
|
|
||||||
|
|
||||||
# Multi-stage build, only need the snaps from the builder. Copy them one at a
|
|
||||||
# time so they can be cached.
|
|
||||||
FROM ubuntu:$UBUNTU
|
|
||||||
COPY --from=builder /snap/core18 /snap/core18
|
|
||||||
COPY --from=builder /snap/snapcraft /snap/snapcraft
|
|
||||||
COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft
|
|
||||||
|
|
||||||
# Generate locale and install dependencies.
|
|
||||||
RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes snapd sudo locales && locale-gen en_US.UTF-8
|
|
||||||
|
|
||||||
# Set the proper environment.
|
|
||||||
ENV LANG="en_US.UTF-8"
|
|
||||||
ENV LANGUAGE="en_US:en"
|
|
||||||
ENV LC_ALL="en_US.UTF-8"
|
|
||||||
ENV PATH="/snap/bin:$PATH"
|
|
||||||
ENV SNAP="/snap/snapcraft/current"
|
|
||||||
ENV SNAP_NAME="snapcraft"
|
|
||||||
ENV SNAP_ARCH="amd64"
|
|
||||||
@ -1,8 +1,6 @@
|
|||||||
FROM debian:stretch
|
ARG REPO=debian
|
||||||
|
ARG TAG=stretch
|
||||||
# add backports (VSCodium)
|
FROM ${REPO}:${TAG}
|
||||||
RUN echo "deb http://deb.debian.org/debian stretch-backports main" | tee -a /etc/apt/sources.list
|
|
||||||
RUN apt-get update && apt-get install -y -t stretch-backports git git-man
|
|
||||||
|
|
||||||
RUN dpkg --add-architecture arm64
|
RUN dpkg --add-architecture arm64
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
@ -32,9 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libc6-dev \
|
libc6-dev \
|
||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
zlib1g-dev \
|
zlib1g-dev
|
||||||
# VSCodium
|
|
||||||
jq
|
|
||||||
|
|
||||||
# Compile python3.9 from source
|
# Compile python3.9 from source
|
||||||
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
|
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
|
||||||
|
|||||||
@ -1,22 +1,20 @@
|
|||||||
FROM debian:stretch
|
ARG REPO=debian
|
||||||
|
ARG TAG=stretch
|
||||||
# add backports (VSCodium)
|
FROM ${REPO}:${TAG}
|
||||||
RUN echo "deb http://deb.debian.org/debian stretch-backports main" | tee -a /etc/apt/sources.list
|
|
||||||
RUN apt-get update && apt-get install -y -t stretch-backports git git-man
|
|
||||||
|
|
||||||
RUN dpkg --add-architecture armhf
|
RUN dpkg --add-architecture armhf
|
||||||
|
|
||||||
|
RUN sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
|
||||||
|
RUN sed -i 's/security.debian.org/archive.debian.org/g' /etc/apt/sources.list
|
||||||
|
RUN sed -i '/stretch-updates/d' /etc/apt/sources.list
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
crossbuild-essential-armhf \
|
crossbuild-essential-armhf \
|
||||||
git \
|
git \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
fakeroot \
|
|
||||||
rpm \
|
|
||||||
sudo \
|
sudo \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
libx11-dev:armhf \
|
|
||||||
libx11-xcb-dev:armhf \
|
|
||||||
libxkbfile-dev:armhf \
|
|
||||||
libsecret-1-dev:armhf \
|
libsecret-1-dev:armhf \
|
||||||
curl \
|
curl \
|
||||||
gnupg \
|
gnupg \
|
||||||
@ -32,9 +30,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libc6-dev \
|
libc6-dev \
|
||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
zlib1g-dev \
|
zlib1g-dev
|
||||||
# VSCodium
|
|
||||||
jq
|
# Remove expired CA cert for openSSL 1.0.2
|
||||||
|
# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
|
||||||
|
RUN rm -f /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
|
||||||
|
RUN update-ca-certificates --fresh
|
||||||
|
|
||||||
|
# Install Node.js
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
|
||||||
|
Run sudo apt-get install -y nodejs
|
||||||
|
RUN node --version
|
||||||
|
|
||||||
|
# Yarn
|
||||||
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||||
|
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
RUN apt-get update && apt-get install -y yarn
|
||||||
|
|
||||||
# Compile python3.9 from source
|
# Compile python3.9 from source
|
||||||
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
|
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
|
||||||
@ -43,16 +54,6 @@ RUN cd Python-3.9.4 && ./configure --enable-optimizations && make altinstall
|
|||||||
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1
|
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1
|
||||||
RUN python --version
|
RUN python --version
|
||||||
|
|
||||||
# Remove expired CA cert for openSSL 1.0.2
|
|
||||||
# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
|
|
||||||
RUN rm -f /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
|
|
||||||
RUN update-ca-certificates --fresh
|
|
||||||
|
|
||||||
# Yarn
|
|
||||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
|
||||||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
|
||||||
RUN apt-get update && apt-get install -y yarn
|
|
||||||
|
|
||||||
ENV AS=/usr/bin/arm-linux-gnueabihf-as \
|
ENV AS=/usr/bin/arm-linux-gnueabihf-as \
|
||||||
AR=/usr/bin/arm-linux-gnueabihf-ar \
|
AR=/usr/bin/arm-linux-gnueabihf-ar \
|
||||||
CC=/usr/bin/arm-linux-gnueabihf-gcc \
|
CC=/usr/bin/arm-linux-gnueabihf-gcc \
|
||||||
@ -61,3 +62,6 @@ ENV AS=/usr/bin/arm-linux-gnueabihf-as \
|
|||||||
LD=/usr/bin/arm-linux-gnueabihf-ld \
|
LD=/usr/bin/arm-linux-gnueabihf-ld \
|
||||||
FC=/usr/bin/arm-linux-gnueabihf-gfortran \
|
FC=/usr/bin/arm-linux-gnueabihf-gfortran \
|
||||||
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
|
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
|
||||||
|
|
||||||
|
RUN mkdir -p /root/vscode
|
||||||
|
WORKDIR /root/vscode
|
||||||
|
|||||||
39
bionic-arm32v7/Dockerfile
Normal file
39
bionic-arm32v7/Dockerfile
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
FROM arm32v7/ubuntu:bionic
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# RUN groupadd --gid 1000 builduser \
|
||||||
|
# && useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
software-properties-common \
|
||||||
|
gcc \
|
||||||
|
g++ \
|
||||||
|
binutils \
|
||||||
|
build-essential \
|
||||||
|
git \
|
||||||
|
pkg-config \
|
||||||
|
sudo \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
gnupg \
|
||||||
|
make \
|
||||||
|
python3 \
|
||||||
|
libkrb5-dev \
|
||||||
|
unzip \
|
||||||
|
# VSCodium
|
||||||
|
jq
|
||||||
|
|
||||||
|
# Set python3 as default
|
||||||
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
||||||
|
RUN python --version
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# # No Sudo Prompt
|
||||||
|
# RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \
|
||||||
|
# && echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
|
||||||
|
|
||||||
|
# USER builduser
|
||||||
|
# WORKDIR /home/builduser
|
||||||
78
bionic-arm64/Dockerfile
Normal file
78
bionic-arm64/Dockerfile
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
|
||||||
|
ARG TAG=18.04
|
||||||
|
FROM ${REPO}:${TAG}
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# RUN groupadd --gid 1000 builduser \
|
||||||
|
# && useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
|
||||||
|
|
||||||
|
# ubuntu keeps its i386/amd64 and other architecture repos separate
|
||||||
|
# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/
|
||||||
|
# add the required repos for armhf/arm64 and only fetch i386/amd64 from archive.ubuntu.com (to prevent apt from erroring about missing architecture support)
|
||||||
|
RUN sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
|
||||||
|
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic main universe multiverse restricted" | tee -a /etc/apt/sources.list
|
||||||
|
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-security main universe multiverse restricted" | tee -a /etc/apt/sources.list
|
||||||
|
RUN echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ bionic-updates main universe multiverse restricted" | tee -a /etc/apt/sources.list
|
||||||
|
RUN dpkg --add-architecture arm64
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
gcc-8-aarch64-linux-gnu \
|
||||||
|
g++-8-aarch64-linux-gnu \
|
||||||
|
binutils-aarch64-linux-gnu \
|
||||||
|
build-essential \
|
||||||
|
git \
|
||||||
|
pkg-config \
|
||||||
|
fakeroot \
|
||||||
|
rpm \
|
||||||
|
sudo \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
libx11-dev:arm64 \
|
||||||
|
libx11-xcb-dev:arm64 \
|
||||||
|
libxkbfile-dev:arm64 \
|
||||||
|
libsecret-1-dev:arm64 \
|
||||||
|
libkrb5-dev:arm64 \
|
||||||
|
curl \
|
||||||
|
gnupg \
|
||||||
|
unzip \
|
||||||
|
# VSCodium
|
||||||
|
jq
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# # No Sudo Prompt
|
||||||
|
# RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \
|
||||||
|
# && echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
|
||||||
|
|
||||||
|
# Set python3 as default
|
||||||
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
||||||
|
RUN python --version
|
||||||
|
|
||||||
|
# Yarn
|
||||||
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||||
|
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
RUN apt-get update && apt-get install -y yarn
|
||||||
|
|
||||||
|
# Node.js
|
||||||
|
RUN curl --silent --location https://deb.nodesource.com/setup_16.x | sudo -E bash -
|
||||||
|
RUN apt-get update && apt-get install -y nodejs
|
||||||
|
RUN npm install -g npm@latest
|
||||||
|
RUN npm install -g node-gyp
|
||||||
|
|
||||||
|
# Install docker client
|
||||||
|
RUN sudo mkdir -m 0755 -p /etc/apt/keyrings
|
||||||
|
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
RUN echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
RUN sudo apt-get update && sudo apt-get install -y docker-ce
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# USER builduser
|
||||||
|
# WORKDIR /home/builduser
|
||||||
|
|
||||||
|
ENV AS=/usr/bin/aarch64-linux-gnu-as \
|
||||||
|
AR=/usr/bin/aarch64-linux-gnu-ar \
|
||||||
|
CC=/usr/bin/aarch64-linux-gnu-gcc-8 \
|
||||||
|
CPP=/usr/bin/aarch64-linux-gnu-cpp-8 \
|
||||||
|
CXX=/usr/bin/aarch64-linux-gnu-g++-8 \
|
||||||
|
LD=/usr/bin/aarch64-linux-gnu-ld \
|
||||||
|
PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
|
||||||
@ -4,6 +4,10 @@ FROM ${REPO}:${TAG}
|
|||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# RUN groupadd --gid 1000 builduser \
|
||||||
|
# && useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
|
||||||
|
|
||||||
# ubuntu keeps its i386/amd64 and other architecture repos separate
|
# ubuntu keeps its i386/amd64 and other architecture repos separate
|
||||||
# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/
|
# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/
|
||||||
# add the required repos for armhf/arm64 and only fetch i386/amd64 from archive.ubuntu.com (to prevent apt from erroring about missing architecture support)
|
# add the required repos for armhf/arm64 and only fetch i386/amd64 from archive.ubuntu.com (to prevent apt from erroring about missing architecture support)
|
||||||
@ -28,11 +32,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libx11-xcb-dev:armhf \
|
libx11-xcb-dev:armhf \
|
||||||
libxkbfile-dev:armhf \
|
libxkbfile-dev:armhf \
|
||||||
libsecret-1-dev:armhf \
|
libsecret-1-dev:armhf \
|
||||||
|
libkrb5-dev:armhf \
|
||||||
curl \
|
curl \
|
||||||
gnupg \
|
gnupg \
|
||||||
unzip \
|
unzip
|
||||||
# VSCodium
|
|
||||||
jq
|
# No Sudo Prompt
|
||||||
|
RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \
|
||||||
|
&& echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# # No Sudo Prompt
|
||||||
|
# RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \
|
||||||
|
# && echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
|
||||||
|
|
||||||
# Set python3 as default
|
# Set python3 as default
|
||||||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
||||||
@ -43,6 +55,22 @@ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
|||||||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
RUN apt-get update && apt-get install -y yarn
|
RUN apt-get update && apt-get install -y yarn
|
||||||
|
|
||||||
|
# Node.js
|
||||||
|
RUN curl --silent --location https://deb.nodesource.com/setup_16.x | sudo -E bash -
|
||||||
|
RUN apt-get update && apt-get install -y nodejs
|
||||||
|
RUN npm install -g npm@latest
|
||||||
|
RUN npm install -g node-gyp
|
||||||
|
|
||||||
|
# Install docker client
|
||||||
|
RUN sudo mkdir -m 0755 -p /etc/apt/keyrings
|
||||||
|
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
RUN echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
RUN sudo apt-get update && sudo apt-get install -y docker-ce
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# USER builduser
|
||||||
|
# WORKDIR /home/builduser
|
||||||
|
|
||||||
ENV AS=/usr/bin/arm-linux-gnueabihf-as \
|
ENV AS=/usr/bin/arm-linux-gnueabihf-as \
|
||||||
AR=/usr/bin/arm-linux-gnueabihf-ar \
|
AR=/usr/bin/arm-linux-gnueabihf-ar \
|
||||||
CC=/usr/bin/arm-linux-gnueabihf-gcc-8 \
|
CC=/usr/bin/arm-linux-gnueabihf-gcc-8 \
|
||||||
|
|||||||
@ -1,20 +1,19 @@
|
|||||||
FROM ubuntu:18.04
|
ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
|
||||||
|
ARG TAG=18.04
|
||||||
|
FROM ${REPO}:${TAG}
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN groupadd --gid 1000 builduser \
|
# Disable user so it can run on GH (VSCodium)
|
||||||
&& useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser \
|
# RUN groupadd --gid 1000 builduser \
|
||||||
&& mkdir -p /setup
|
# && useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser \
|
||||||
|
|
||||||
|
RUN mkdir -p /setup
|
||||||
|
|
||||||
# Set up TEMP directory
|
# Set up TEMP directory
|
||||||
ENV TEMP=/tmp
|
ENV TEMP=/tmp
|
||||||
RUN chmod a+rwx /tmp
|
RUN chmod a+rwx /tmp
|
||||||
|
|
||||||
# Core environment variables
|
|
||||||
ENV LANG="en_US.UTF-8" \
|
|
||||||
LANGUAGE="en_US.UTF-8" \
|
|
||||||
LC_ALL="en_US.UTF-8"
|
|
||||||
|
|
||||||
# Latest stable git
|
# Latest stable git
|
||||||
RUN apt-get update && apt-get install -y software-properties-common
|
RUN apt-get update && apt-get install -y software-properties-common
|
||||||
RUN add-apt-repository ppa:git-core/ppa -y
|
RUN add-apt-repository ppa:git-core/ppa -y
|
||||||
@ -23,6 +22,7 @@ RUN apt-get update && apt-get install -y \
|
|||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
|
file \
|
||||||
git \
|
git \
|
||||||
gnome-keyring \
|
gnome-keyring \
|
||||||
iproute2 \
|
iproute2 \
|
||||||
@ -32,6 +32,7 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libgl1 \
|
libgl1 \
|
||||||
libgtk-3.0 \
|
libgtk-3.0 \
|
||||||
libsecret-1-dev \
|
libsecret-1-dev \
|
||||||
|
libkrb5-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
libx11-dev \
|
libx11-dev \
|
||||||
libx11-xcb-dev \
|
libx11-xcb-dev \
|
||||||
@ -40,7 +41,7 @@ RUN apt-get update && apt-get install -y \
|
|||||||
lsb-release \
|
lsb-release \
|
||||||
lsof \
|
lsof \
|
||||||
python-dbus \
|
python-dbus \
|
||||||
python-pip \
|
python3-pip \
|
||||||
sudo \
|
sudo \
|
||||||
wget \
|
wget \
|
||||||
xvfb \
|
xvfb \
|
||||||
@ -49,45 +50,45 @@ RUN apt-get update && apt-get install -y \
|
|||||||
# VSCodium
|
# VSCodium
|
||||||
jq \
|
jq \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
&& locale-gen en_US.UTF-8 \
|
|
||||||
&& curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.sh\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.sh \
|
&& curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.sh\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.sh \
|
||||||
|
&& curl https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.py\?format\=TEXT | base64 --decode | cat > /setup/install-build-deps.py \
|
||||||
|
# Remove snapcraft to avoid issues on docker build
|
||||||
|
&& sed -i 's/packages.append("snapcraft")/#packages.append("snapcraft")/g' /setup/install-build-deps.py \
|
||||||
&& chmod +x /setup/install-build-deps.sh \
|
&& chmod +x /setup/install-build-deps.sh \
|
||||||
&& bash /setup/install-build-deps.sh --syms --no-prompt --no-chromeos-fonts --no-arm --no-nacl \
|
&& chmod +x /setup/install-build-deps.py \
|
||||||
|
&& bash /setup/install-build-deps.sh --no-syms --no-prompt --no-chromeos-fonts --no-arm --no-nacl \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Disable user so it can run on GH (VSCodium)
|
||||||
|
# # No Sudo Prompt
|
||||||
|
# RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \
|
||||||
|
# && echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
|
||||||
|
|
||||||
# Yarn
|
# Yarn
|
||||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
RUN apt-get update && apt-get install -y yarn
|
RUN apt-get update && apt-get install -y yarn
|
||||||
|
|
||||||
# ripgrep (VSCodium)
|
# Node.js
|
||||||
RUN wget -q https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb
|
RUN curl --silent --location https://deb.nodesource.com/setup_16.x | sudo -E bash -
|
||||||
RUN dpkg -i ripgrep_13.0.0_amd64.deb
|
RUN apt-get update && apt-get install -y nodejs
|
||||||
|
RUN npm install -g npm@latest
|
||||||
# No Sudo Prompt
|
RUN npm install -g node-gyp
|
||||||
RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser \
|
|
||||||
&& echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
|
|
||||||
|
|
||||||
# Dotnet
|
|
||||||
RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
|
|
||||||
RUN dpkg -i packages-microsoft-prod.deb
|
|
||||||
RUN apt-get update && apt-get install -y dotnet-sdk-2.1
|
|
||||||
|
|
||||||
# Set python3 as default
|
# Set python3 as default
|
||||||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
||||||
RUN python --version
|
RUN python --version
|
||||||
|
|
||||||
# Add xvfb init script
|
# Install docker client
|
||||||
COPY xvfb-init.sh /etc/init.d/xvfb
|
RUN sudo mkdir -m 0755 -p /etc/apt/keyrings
|
||||||
RUN chmod a+x /etc/init.d/xvfb
|
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
RUN echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
# Setup dbus path
|
RUN sudo apt-get update && sudo apt-get install -y docker-ce
|
||||||
RUN sudo mkdir -p /var/run/dbus
|
|
||||||
|
|
||||||
# Check compiler toolchain
|
# Check compiler toolchain
|
||||||
RUN gcc --version
|
RUN gcc --version
|
||||||
RUN g++ --version
|
RUN g++ --version
|
||||||
|
|
||||||
# Disable user to it can run on GH (VSCodium)
|
# Disable user so it can run on GH (VSCodium)
|
||||||
# USER builduser
|
# USER builduser
|
||||||
# WORKDIR /home/builduser
|
# WORKDIR /home/builduser
|
||||||
|
|||||||
@ -6,8 +6,10 @@ ARG INSTALL_PKGS="devtoolset-8-gcc \
|
|||||||
devtoolset-8-gdb \
|
devtoolset-8-gdb \
|
||||||
make \
|
make \
|
||||||
git \
|
git \
|
||||||
|
unzip \
|
||||||
sudo \
|
sudo \
|
||||||
libsecret-devel \
|
libsecret-devel \
|
||||||
|
krb5-devel \
|
||||||
nodejs \
|
nodejs \
|
||||||
python3"
|
python3"
|
||||||
|
|
||||||
@ -19,9 +21,10 @@ RUN yum install -y centos-release-scl-rh && \
|
|||||||
rpm -V $INSTALL_PKGS && \
|
rpm -V $INSTALL_PKGS && \
|
||||||
yum -y clean all --enablerepo='*'
|
yum -y clean all --enablerepo='*'
|
||||||
|
|
||||||
# update npm and install yarn
|
# update npm and install yarn, node-gyp
|
||||||
RUN npm install -g npm@latest
|
RUN npm install -g npm@latest
|
||||||
RUN npm install -g yarn
|
RUN npm install -g yarn
|
||||||
|
RUN npm install -g node-gyp
|
||||||
|
|
||||||
# jq (VSCodium)
|
# jq (VSCodium)
|
||||||
RUN curl -L -O https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
|
RUN curl -L -O https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
|
||||||
|
|||||||
@ -8,6 +8,7 @@ ARG INSTALL_PKGS="devtoolset-8-gcc \
|
|||||||
devtoolset-8-gdb \
|
devtoolset-8-gdb \
|
||||||
make \
|
make \
|
||||||
git \
|
git \
|
||||||
|
unzip \
|
||||||
sudo \
|
sudo \
|
||||||
libsecret-devel \
|
libsecret-devel \
|
||||||
krb5-devel \
|
krb5-devel \
|
||||||
@ -22,9 +23,10 @@ RUN yum install -y centos-release-scl-rh && \
|
|||||||
rpm -V $INSTALL_PKGS && \
|
rpm -V $INSTALL_PKGS && \
|
||||||
yum -y clean all --enablerepo='*'
|
yum -y clean all --enablerepo='*'
|
||||||
|
|
||||||
# update npm and install yarn
|
# update npm and install yarn, node-gyp
|
||||||
RUN npm install -g npm@latest
|
RUN npm install -g npm@latest
|
||||||
RUN npm install -g yarn
|
RUN npm install -g yarn
|
||||||
|
RUN npm install -g node-gyp
|
||||||
|
|
||||||
# jq (VSCodium)
|
# jq (VSCodium)
|
||||||
RUN curl -L -O https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
|
RUN curl -L -O https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
|
||||||
@ -33,5 +35,10 @@ RUN curl -L -O https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux6
|
|||||||
|
|
||||||
ENV PATH=/opt/rh/devtoolset-8/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
ENV PATH=/opt/rh/devtoolset-8/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
|
# install cmake3
|
||||||
|
RUN git clone https://gitlab.kitware.com/cmake/cmake.git
|
||||||
|
RUN cd cmake && git checkout v3.26.0 && ./bootstrap --prefix=/usr/local -- -DCMAKE_USE_OPENSSL=OFF \
|
||||||
|
make && make install
|
||||||
|
|
||||||
RUN mkdir -p /root/vscode
|
RUN mkdir -p /root/vscode
|
||||||
WORKDIR /root/vscode
|
WORKDIR /root/vscode
|
||||||
|
|||||||
72
snapcraft-x64/Dockerfile
Normal file
72
snapcraft-x64/Dockerfile
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
ARG RISK=stable
|
||||||
|
ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu
|
||||||
|
ARG TAG=20.04
|
||||||
|
|
||||||
|
FROM ${REPO}:${TAG} as builder
|
||||||
|
ARG RISK
|
||||||
|
ARG REPO
|
||||||
|
ARG TAG
|
||||||
|
RUN echo "Building snapcraft:$RISK in $REPO:$TAG"
|
||||||
|
|
||||||
|
# Grab dependencies
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get dist-upgrade --yes
|
||||||
|
RUN apt-get install --yes \
|
||||||
|
curl \
|
||||||
|
jq \
|
||||||
|
squashfs-tools \
|
||||||
|
git \
|
||||||
|
build-essential \
|
||||||
|
libkrb5-dev \
|
||||||
|
autoconf
|
||||||
|
|
||||||
|
# Grab the core20 snap (which snapcraft uses as a base) from the stable channel
|
||||||
|
# and unpack it in the proper place.
|
||||||
|
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core20' | jq '.download_url' -r) --output core20.snap
|
||||||
|
RUN mkdir -p /snap/core20
|
||||||
|
RUN unsquashfs -d /snap/core20/current core20.snap
|
||||||
|
|
||||||
|
# Grab the snapcraft snap from the $RISK channel and unpack it in the proper
|
||||||
|
# place.
|
||||||
|
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel='$RISK | jq '.download_url' -r) --output snapcraft.snap
|
||||||
|
RUN mkdir -p /snap/snapcraft
|
||||||
|
RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap
|
||||||
|
|
||||||
|
# Fix Python3 installation: Make sure we use the interpreter from
|
||||||
|
# the snapcraft snap:
|
||||||
|
RUN unlink /snap/snapcraft/current/usr/bin/python3
|
||||||
|
RUN ln -s /snap/snapcraft/current/usr/bin/python3.* /snap/snapcraft/current/usr/bin/python3
|
||||||
|
RUN echo /snap/snapcraft/current/lib/python3.*/site-packages >> /snap/snapcraft/current/usr/lib/python3/dist-packages/site-packages.pth
|
||||||
|
RUN /snap/snapcraft/current/usr/bin/python3 /snap/snapcraft/current/usr/bin/pip3 install -U setuptools
|
||||||
|
|
||||||
|
# Create a snapcraft runner (TODO: move version detection to the core of
|
||||||
|
# snapcraft).
|
||||||
|
RUN mkdir -p /snap/bin
|
||||||
|
RUN echo "#!/bin/sh" > /snap/bin/snapcraft
|
||||||
|
RUN snap_version="$(awk '/^version:/{print $2}' /snap/snapcraft/current/meta/snap.yaml | tr -d \')" && echo "export SNAP_VERSION=\"$snap_version\"" >> /snap/bin/snapcraft
|
||||||
|
RUN echo 'exec "$SNAP/usr/bin/python3" "$SNAP/bin/snapcraft" "$@"' >> /snap/bin/snapcraft
|
||||||
|
RUN chmod +x /snap/bin/snapcraft
|
||||||
|
|
||||||
|
# Build patchelf
|
||||||
|
RUN git clone https://github.com/NixOS/patchelf
|
||||||
|
RUN cd patchelf && ./bootstrap.sh && ./configure && make && make check && cp ./src/patchelf /snap/bin/patchelf
|
||||||
|
|
||||||
|
# Multi-stage build, only need the snaps from the builder. Copy them one at a
|
||||||
|
# time so they can be cached.
|
||||||
|
FROM ${REPO}:${TAG}
|
||||||
|
COPY --from=builder /snap/core20 /snap/core20
|
||||||
|
COPY --from=builder /snap/snapcraft /snap/snapcraft
|
||||||
|
COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft
|
||||||
|
COPY --from=builder /snap/bin/patchelf /snap/bin/patchelf
|
||||||
|
|
||||||
|
# Generate locale and install dependencies.
|
||||||
|
RUN apt-get update && apt-get install --yes snapd sudo locales && locale-gen en_US.UTF-8
|
||||||
|
|
||||||
|
# Set the proper environment.
|
||||||
|
ENV LANG="en_US.UTF-8"
|
||||||
|
ENV LANGUAGE="en_US:en"
|
||||||
|
ENV LC_ALL="en_US.UTF-8"
|
||||||
|
ENV SNAP="/snap/snapcraft/current"
|
||||||
|
ENV SNAP_NAME="snapcraft"
|
||||||
|
ENV SNAP_ARCH="amd64"
|
||||||
|
ENV PATH="/snap/bin:/snap/snapcraft/current/usr/bin:$PATH"
|
||||||
Loading…
x
Reference in New Issue
Block a user