|
| 1 | +ARG REPO=mcr.microsoft.com/mirror/docker/library/ubuntu |
| 2 | +ARG TAG=20.04 |
| 3 | +FROM ${REPO}:${TAG} |
| 4 | + |
| 5 | +ARG DEBIAN_FRONTEND=noninteractive |
| 6 | +ARG NODE_VERSION="16.20.2" |
| 7 | + |
| 8 | +# ubuntu keeps its i386/amd64 and other architecture repos separate |
| 9 | +# the default i386/amd64 packages can be found in http://archive.ubuntu.com while all other architectures are in http://ports.ubuntu.com/ |
| 10 | +# add the required repos for s390x and only fetch i386/amd64 from archive.ubuntu.com (to prevent apt from erroring about missing architecture support) |
| 11 | +RUN sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list |
| 12 | +RUN echo "deb [arch=s390x] http://ports.ubuntu.com/ focal main universe multiverse restricted" | tee -a /etc/apt/sources.list |
| 13 | +RUN echo "deb [arch=s390x] http://ports.ubuntu.com/ focal-security main universe multiverse restricted" | tee -a /etc/apt/sources.list |
| 14 | +RUN echo "deb [arch=s390x] http://ports.ubuntu.com/ focal-updates main universe multiverse restricted" | tee -a /etc/apt/sources.list |
| 15 | +RUN dpkg --add-architecture s390x |
| 16 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 17 | + gcc-10-s390x-linux-gnu \ |
| 18 | + g++-10-s390x-linux-gnu \ |
| 19 | + binutils-s390x-linux-gnu \ |
| 20 | + build-essential \ |
| 21 | + git \ |
| 22 | + pkg-config \ |
| 23 | + fakeroot \ |
| 24 | + rpm \ |
| 25 | + sudo \ |
| 26 | + apt-transport-https \ |
| 27 | + ca-certificates \ |
| 28 | + libx11-dev:s390x \ |
| 29 | + libx11-xcb-dev:s390x \ |
| 30 | + libxkbfile-dev:s390x \ |
| 31 | + libsecret-1-dev:s390x \ |
| 32 | + libkrb5-dev:s390x \ |
| 33 | + libatomic1:s390x \ |
| 34 | + curl \ |
| 35 | + gnupg \ |
| 36 | + unzip \ |
| 37 | + # VSCodium |
| 38 | + jq |
| 39 | + |
| 40 | +# Set python3 as default |
| 41 | +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 |
| 42 | +RUN python --version |
| 43 | + |
| 44 | +# Setup Node.js |
| 45 | +RUN curl -L -O https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-s390x.tar.gz && \ |
| 46 | + tar -xzf node-v${NODE_VERSION}-linux-s390x.tar.gz && \ |
| 47 | + cp -R node-v${NODE_VERSION}-linux-s390x/* /usr/local/ && \ |
| 48 | + rm -rf node-v${NODE_VERSION}-linux-s390x* && \ |
| 49 | + node --version |
| 50 | + |
| 51 | +# install yarn & node-gyp |
| 52 | +RUN npm install -g yarn node-gyp |
| 53 | + |
| 54 | +# Set gcc-10 as default |
| 55 | +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/s390x-linux-gnu-gcc-10 10 |
| 56 | +RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/s390x-linux-gnu-g++-10 10 |
| 57 | + |
| 58 | +# Check compiler toolchain |
| 59 | +RUN gcc --version |
| 60 | +RUN g++ --version |
| 61 | + |
| 62 | +RUN mkdir -p /root/vscode |
| 63 | +WORKDIR /root/vscode |
| 64 | + |
| 65 | +ENV AS=/usr/bin/s390x-linux-gnu-as \ |
| 66 | + AR=/usr/bin/s390x-linux-gnu-ar \ |
| 67 | + CC=/usr/bin/s390x-linux-gnu-gcc-10 \ |
| 68 | + CPP=/usr/bin/s390x-linux-gnu-cpp-10 \ |
| 69 | + CXX=/usr/bin/s390x-linux-gnu-g++-10 \ |
| 70 | + LD=/usr/bin/s390x-linux-gnu-ld \ |
| 71 | + PKG_CONFIG_PATH=/usr/lib/s390x-linux-gnu/pkgconfig |
0 commit comments