To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 73f04b40 authored by Philipp Miedl's avatar Philipp Miedl

Initial commit

parents
!Makefile
# A simple makefile that only enforces name compatibility. The values below
# determine the namespace and image names to be used when building.
# main namespace, useful when building for distributing in hubs.
NAMESPACE=tooling
# name of the base image
IMAGE_BASE=base
# name of the scripted image
IMAGE_SCRIPTED=dock
# name of the ssh image
IMAGE_SSH=ssh
# tag to be used when building images
IMAGE_TAG=latest
# name of the ssh image script
SSH_RUN_SCRIPT=start-ssh-builder
# name of shell for ssh image
USER_SHELL=bash
# GNU Make is a bit idiotic when it comes to creating multiline expressions...
# It is not possible to make a sed program using the 'a' command because of its
# requirement to include a newline characted. Autoconf manual suggests using:
#
# nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"
#
# which is even worse of a hack, and in fact does not work either. Therefore
# below a separate target writes a config which is then appended using sed.
host-script-config:
@echo "CONFIG_NAMESPACE=${NAMESPACE}" > generated-config.txt
@echo "CONFIG_IMAGE_SCRIPTED=${IMAGE_SCRIPTED}" >> generated-config.txt
@echo "CONFIG_IMAGE_SSH=${IMAGE_SSH}" >> generated-config.txt
@echo "CONFIG_IMAGE_TAG=${IMAGE_TAG}" >> generated-config.txt
@echo "CONFIG_USER_SHELL=${USER_SHELL}" >> generated-config.txt
# Rule to create a user-script for running commands in the container.
host-script: src/host-script.sh host-script-config
@sed -e '/Makefile/ r generated-config.txt' $< > scripts/${IMAGE_SCRIPTED}
@rm generated-config.txt
# Rule to create a user-script for running commands in the container.
host-script-ssh: src/host-script-ssh.sh host-script-config
@sed -e '/Makefile/ r generated-config.txt' $< > scripts/${SSH_RUN_SCRIPT}
@rm generated-config.txt
echo-script: host-script
@cat scripts/${IMAGE_SCRIPTED}
echo-script-ssh: host-script-ssh
@cat scripts/${SSH_RUN_SCRIPT}
# Rule to build the base image, containing the compilers and build support.
base:
@docker build \
--build-arg NAMESPACE=$(NAMESPACE) \
--build-arg IMAGE_BASE=$(IMAGE_BASE) \
--tag "${NAMESPACE}/${IMAGE_BASE}:${IMAGE_TAG}" \
-f base.Dockerfile .
line=$(shell head -c 80 /dev/zero | tr '\0' '-')
# Rule to build the image with extended user support.
scripted: base host-script
@docker build \
--build-arg NAMESPACE=${NAMESPACE} \
--build-arg IMAGE_BASE=${IMAGE_BASE} \
--build-arg IMAGE_SCRIPTED=${IMAGE_SCRIPTED} \
--build-arg IMAGE_TAG=${IMAGE_TAG} \
--tag "${NAMESPACE}/${IMAGE_SCRIPTED}:${IMAGE_TAG}" \
-f scripted.Dockerfile .
@chmod u+x scripts/${IMAGE_SCRIPTED}
@echo $(line)
@echo "The user script is available at scripts/${IMAGE_SCRIPTED}."
@echo "For convienience, you may copy the script somewhere in your PATH."
@echo "Alternatively, use the 'echo-script' make rule to get the script to"
@echo "standard output."
@echo $(line)
ssh: host-script-ssh
@docker build \
--build-arg NAMESPACE=${NAMESPACE} \
--build-arg IMAGE_BASE=${IMAGE_BASE} \
--build-arg IMAGE_SSH=${IMAGE_SSH} \
--build-arg IMAGE_TAG=${IMAGE_TAG} \
--tag "${NAMESPACE}/${IMAGE_SSH}:${IMAGE_TAG}" \
-f ssh.Dockerfile .
@chmod u+x scripts/${SSH_RUN_SCRIPT}
.PHONY: clean delete-images
clean:
-rm -f scripts/${IMAGE_SCRIPTED}
-rm -f scripts/${SSH_RUN_SCRIPT}
-rm -f generated-config.txt
delete-images:
docker rmi $(shell docker images -q "${NAMESPACE}/${IMAGE_SCRIPTED}")
docker rmi $(shell docker images -q "${NAMESPACE}/${IMAGE_SSH}")
docker rmi $(shell docker images -q "${NAMESPACE}/${IMAGE_BASE}")
### Dockerised build environment
This directory contains the sources necessary for building [Docker](https://docs.docker.com) containers, which encapsulate the required tools for building C and C++ based projects. The container is based on the latest Ubuntu LTS, and supports cross-compiling for x86_64, aarch64, and 32-bit arm architectures with soft and hard floating-point implementations.
> *Note:* At the moment the images have to be built locally. Pulling directly from git should be quite straightforward, but would require some minor manual changes to the host script.
The script running on the host and the entrypoint script running inside the container were inspired by [sdt/docker-raspberry-pi-cross-compiler](https://github.com/sdt/docker-raspberry-pi-cross-compiler). The main idea is to have a script which passes all commands and arguments to the container, which runs them with the host's UID, GID, username and group. Thanks to that, there are no permission/access issues on the host's side. The [host script](src/host-script.sh) mounts the host's current working directory inside the container.
Additionally, a number of CMake toolchains are available inside the container for further convenience. These are available for targets **x86_64**, **aarch64**, **arm**, and **armhf**, in **basic** (dynamic linkage), **static** (static linkage), and **rpath** (dynamic linkage with current directory set as runtime load path) configurations. These are available in the container at `/tool/{basic,static,rpath}/{x86_64,aarch64,arm,armhf}.cmake`.
### Requirements
To successfully build and use the Docker containers, a recent version of Docker is required.
> **Note:** The version of Docker available default repositories might be outdated. Follow the guides available at *[Docker → Guides → Install → Supported platforms](https://docs.docker.com/install/#supported-platforms)*.
- On macOS, download the [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/);
- On Windows download the [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/);
- For Linux, a number of guides are available for [Debian](https://docs.docker.com/install/linux/docker-ce/debian/), [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/), and [Fedora](https://docs.docker.com/install/linux/docker-ce/fedora/).
The fastest way of installing Docker on Linux via https://get.docker.com:
```sh
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
```
The following are the steps required on [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/):
1. Remove old versions of Docker:
```sh
sudo apt-get remove docker docker-engine docker.io containerd runc
```
2. Set up Docker repositories:
```sh
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
```
3. Install Docker:
```sh
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
4. [Post-installation step](https://docs.docker.com/install/linux/linux-postinstall/) → Add yourself to the *docker* group to use Docker as a non-root user:
```sh
sudo usermod -aG docker $USER
```
### How to build?
Make sure that docker is running before proceeding with installation.
To build the container images, clone the repository and navigate to the folder in which this README is contained, and use `make`. The contained [Makefile](./Makefile) defines the following rules:
- __*base*: build the base image__,
- __*scripted*: build the extended image, depends on *base*__,
- __*ssh*: build the ssh development image, depends on *base*__,
- *host-script*: create a the script to run commands in the *scripted* container, depends on *host-script-config*,
- *host-script-config*: create a config file for the script above,
- *host-script-ssh*: create a config file for the script above,
- *echo-script*: echo the 'scripted' script to stdout,
- *echo-script-ssh*: echo the 'ssh' script to stdout,
- *clean*: clean the script and config files,
- *delete-images*: delete docker images created using the script.
The following variables, defined in the Makefile, can be used to customise the configuration:
- `NAMESPACE`: the namespace with which the images will be tagged, default: *tooling*;
- `IMAGE_BASE`: the name of the base image, default: *base*;
- `IMAGE_SCRIPTED`: the name of the image with extended user-scripting support, default: *dock*;
- `IMAGE_SSH`: the name of the image with SSH-support, default: *ssh*;
- `IMAGE_TAG`: the tag which will be used during the build, default: *latest*;
- `SSH_RUN_SCRIPT`: the name of the script spawning the SSH image, default: *start-ssh-builder*;
- `USER_SHELL`: the name of the desired shell for the SSH image, default: *bash*.
During build time, the *base* image will report the installed versions of the contained tools. When building the *scripted* some further information will be displayed.
### How to use?
After building the image using the *scripted* rule, a special script will be created. For the sake of convenience, the script can be copied somewhere in the user's PATH.
Assuming that the created script was called *dock*, one can, for example, build a CMake project by running on the host machine:
```sh
dock cmake -DCMAKE_TOOLCHAIN_FILE=/tool/static/x86_64.cmake -DCMAKE_BUILD_TYPE=Debug -B build/linux-amd64 -H.
dock cmake --build build/linux-amd64 --target <target>
```
To output the version info of the installed compilers and tools, run:
```sh
dock /setup/print-env.sh
```
To get a shell inside the container, one can run:
```sh
dock /usr/bin/env bash
```
To bypass the entrypoint script in the *scripted* or to get a shell in the *base* container, on create a docker container manually (assumes images *tooling/base* and *tooling/dock*):
```sh
docker run --interactive --tty --rm tooling/base /bin/bash
# or
docker run --interactive --tty --rm --entrypoint /bin/bash tooling/base
# or
docker run --interactive --tty --rm --entrypoint /bin/bash tooling/dock
```
#### SSH development environment
The SSH development image can be used to take advantage of the provided tooling
from a remote machine, or in IDEs that can use remote SSH machines (e.g. CLion, PyCharm).
The user launch script, *start-ssh-builder*, can be used to launch the container.
The script will import the user's public SSH identity file and push it to
the authorized keys of root and newly created users.
Unlike the 'scripted' image, the SSH container is persistent, and will run as long
as the SSH daemon is running. To turn it off, either poweroff via SSH, or:
```bash
docker stop tooling-ssh # the default name
docker stop $(docker ps -a -q) # stop all containers
```
# The following Dockerfile defines a basic container based on the latest
# Ubuntu LTS distribution, which contains the build environment necessary for
# building C and C++ projects.
#
# The currently available target architectures are:
# - x86_64
# - aarch64 (64-bit ARMv8)
# - arm (32-bit ARM with soft floating-point implementation)
# - armhf (32-bit ARM with hard floating-point implementation)
#
# Additionally, make, ninja, and CMake are available for futher support.
# Lastly, clang tooling is available for formatting (using clang-format) and
# static analysis (using clang-tidy).
# use the latest LTS distribution
FROM ubuntu:latest
MAINTAINER Bruno Klopott "klopottb@student.ethz.ch"
ARG NAMESPACE=tooling
ARG IMAGE_BASE=base
# compiler & tools versions
ARG GCC_VER="8"
ARG CLANG_VER="6.0"
# environment variables for apt
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=linux
# update repositories
RUN apt-get update -q --yes
# install apt-utils to silence some warning messages
RUN apt-get install -q --no-install-recommends --yes \
dialog \
apt-utils
# make apt use a secure transport protocol
RUN apt-get install -q --no-install-recommends --yes \
apt-transport-https \
ca-certificates
# install gcc with C++ support for x86, aarch64, arm, and armhf
RUN apt-get install -q --no-install-recommends --yes \
gcc-$GCC_VER \
gcc-$GCC_VER-aarch64-linux-gnu \
gcc-$GCC_VER-arm-linux-gnueabi \
gcc-$GCC_VER-arm-linux-gnueabihf \
g++-$GCC_VER \
g++-$GCC_VER-aarch64-linux-gnu \
g++-$GCC_VER-arm-linux-gnueabi \
g++-$GCC_VER-arm-linux-gnueabihf
# install build tools
RUN apt-get install -q --no-install-recommends --yes \
ninja-build \
make \
cmake
# install the formatter and static analyser
RUN apt-get install -q --no-install-recommends --yes \
clang-format-$CLANG_VER \
clang-tidy-$CLANG_VER
# clean up after apt
RUN apt-get clean -q --yes
# set root password to "root" using /usr/sbin/chpasswd
RUN echo "root:root" | chpasswd
# copy util scripts
COPY scripts/print-env.sh /setup/
RUN chmod 755 /setup/print-env.sh
RUN /setup/print-env.sh
LABEL org.label-schema.name="$NAMESPACE/$IMAGE_BASE" \
org.label-schema.name="A complete environment necessary for building C and C++ projects for AMD64, 32-bit and 64-bit ARM." \
org.label-schema.schema-version="1.0"
# The following Dockerfile builds upon the base image with compilation support,
# and provides a special host-side script, and an entrypoint script. They
# allow mounting the current host directory in the container, while maintaining
# the same user/group names and ids, such that all permissions are maintained.
# A regular docker container runs everything as root, preventing the user from
# making any changes to files.
# Note: A recent version of docker is required for using ARGs before the FROM
# statement. If only an older version (e.g. 1.13) is available, comment out the
# following statements and provide the necessary variables via "--build-arg"
# command line options to the "docker build" command.
ARG NAMESPACE=tooling
ARG IMAGE_BASE=base
ARG IMAGE_SCRIPTED=dock
ARG IMAGE_TAG=latest
FROM $NAMESPACE/$IMAGE_BASE:$IMAGE_TAG
MAINTAINER Bruno Klopott "klopottb@student.ethz.ch"
# install the gosu tool for matching entrypoint user/group
RUN apt-get install -q --no-install-recommends --yes \
gosu
# clean up after apt
RUN apt-get clean -q --yes
# copy user scripts to /setup on the container
COPY scripts/$IMAGE_SCRIPTED scripts/entry.sh /setup/
RUN chmod 755 /setup/*
# copy toolchains to /tool on the container
COPY toolchains/ /tool
WORKDIR /workdir
ENTRYPOINT ["/setup/entry.sh"]
LABEL org.label-schema.name="$NAMESPACE/$IMAGE_SCRIPTED" \
org.label-schema.name="A complete environment necessary for cross-compiling C and C++ projects with extended support." \
org.label-schema.schema-version="1.0"
#!/usr/bin/env bash
# This script attempts to run the command passed to the container with the
# same user/group as the host.
# If user and group ids are set, they will be of non-zero length. Flag (-n)
# returns true if a value is non-zero.
if [[ -n $HOST_UID ]] && [[ -n $HOST_GID ]]; then
# Create a group matching the host group
groupadd --non-unique \
--gid $HOST_GID $HOST_GROUP 2>/dev/null
# Create a user matching the host user
useradd --non-unique --create-home \
--gid $HOST_GID \
--uid $HOST_UID $HOST_USER 2>/dev/null
export HOME=/home/${HOST_USER}
# Copy files in /root to the new user's home directory
shopt -s dotglob
cp -r /root/* $HOME/
chown -R $HOST_UID:$HOST_GID $HOME 2>/dev/null
# Set setuid bit on the gosu binary to allow sudo capabilities without the
# need for a password.
chown root:$HOST_GID $(which gosu) 2>/dev/null
chmod +s $(which gosu 2>/dev/null); sync 2>/dev/null
# Execute the command as the new user
exec gosu $HOST_UID:$HOST_GID "$@"
else
exec "$@"
fi
#!/usr/bin/env bash
line=$(head -c 80 /dev/zero | tr '\0' '-')
echo $line
echo
echo "GNU compilers' versions:"
echo " - x86_64: $(gcc-8 --version | grep gcc)"
echo " - 64b arm: $(aarch64-linux-gnu-gcc-8 --version | grep gcc)"
echo " - 32b arm (sf): $(arm-linux-gnueabi-gcc-8 --version | grep gcc)"
echo " - 32b arm (hf): $(arm-linux-gnueabihf-gcc-8 --version | grep gcc)"
echo "Build programs' versions:"
echo " - CMake: $(cmake --version | grep version)"
echo " - make: $(make --version | grep Make)"
echo " - ninja: $(ninja --version)"
echo "Support programs' versions:"
echo " - clang-format: $(clang-format-6.0 --version | grep version)"
echo " - clang-tidy: $(clang-tidy-6.0 --version | grep version)"
echo
echo $line
#!/usr/bin/env bash
# If user and group ids are set, they will be of non-zero length. Flag (-n)
# returns true if a value is non-zero.
if [[ -n $HOST_UID ]] && [[ -n $HOST_GID ]]; then
# Create a group matching the host group
groupadd --non-unique \
--gid $HOST_GID $HOST_GROUP 2>/dev/null
# Create a user matching the host user
useradd --non-unique --create-home \
--gid $HOST_GID \
--uid $HOST_UID $HOST_USER 2>/dev/null
export HOME=/home/${HOST_USER}
echo "$HOST_USER:*" | chpasswd -e
usermod -p "" $HOST_USER
if [[ -n $HOST_PUBKEY ]]; then
mkdir -p $HOME/.ssh/
mkdir -p /root/.ssh/
echo $HOST_PUBKEY >> $HOME/.ssh/authorized_keys
echo $HOST_PUBKEY >> /root/.ssh/authorized_keys
chmod 600 $HOME/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
chown $HOST_UID:$HOST_GID $HOME/.ssh/authorized_keys
fi
chown -R $HOST_UID:$HOST_GID $HOME 2>/dev/null
if [[ -n $USER_SHELL ]]; then
apt-get install -q --no-install-recommends --yes $(basename $USER_SHELL)\
&& usermod --shell $(which $(basename $USER_SHELL)) root\
&& usermod --shell $(which $(basename $USER_SHELL)) $HOST_USER
fi
fi
#!/usr/bin/env bash
# Makefile
# ------------------------------------------------------------------------------
# Configuration
SCRIPT_NAME=$(basename $0)
DOCKER_IMAGE_NAMESPACE="${CONFIG_NAMESPACE:-tooling}"
DOCKER_IMAGE_NAME="${CONFIG_IMAGE_SSH:-ssh}"
DOCKER_IMAGE_TAG="${CONFIG_IMAGE_TAG:-latest}"
DOCKER_IMAGE="$DOCKER_IMAGE_NAMESPACE/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG"
CONTAINER_NAME="${DOCKER_IMAGE_NAMESPACE}-${DOCKER_IMAGE_NAME}"
USER_SHELL="${CONFIG_USER_SHELL}"
# Check if docker is available and the daemon is running
`which docker 1>/dev/null 2>/dev/null` || \
error_and_exit "Docker does not seem to be available on the host device."
`docker ps -q 1>/dev/null 2>/dev/null` || \
error_and_exit "Docker daemon does not seem to be running."
# Get current host working directory, user and group ids and names
HOST_WD=`/bin/pwd -P`
HOST_UID="$(id -u)"
HOST_GID="$(id -g)"
HOST_USER="$(id -un)"
HOST_GROUP="$(id -gn)"
HOST_PORT=${CONFIG_HOST_PORT:-9999}
if [[ -r $HOME/.ssh/id_rsa.pub ]]; then
HOST_PUBKEY=$(cat $HOME/.ssh/id_rsa.pub)
fi
# Run the docker container, pass arguments and environment variables
docker run -d --rm \
-p $HOST_PORT:22 \
--name $CONTAINER_NAME \
-v "$HOST_WD":/workdir \
-e HOST_UID=$HOST_UID \
-e HOST_GID=$HOST_GID \
-e HOST_USER=$HOST_USER \
-e HOST_GROUP=$HOST_GROUP \
-e HOST_PUBKEY="$HOST_PUBKEY" \
-e USER_SHELL=$USER_SHELL \
$DOCKER_IMAGE
echo "Container with name \"$CONTAINER_NAME\" started."
echo "Container can be accessed via SSH on port $HOST_PORT."
# Exit with the return code of the docker run command above
exit $?
#!/usr/bin/env bash
# Makefile
# ------------------------------------------------------------------------------
# Configuration
SCRIPT_NAME=$(basename $0)
DOCKER_IMAGE_NAMESPACE="${CONFIG_NAMESPACE:-tooling}"
DOCKER_IMAGE_NAME="${CONFIG_IMAGE_SCRIPTED:-dock}"
DOCKER_IMAGE_TAG="${CONFIG_IMAGE_TAG:-latest}"
DOCKER_IMAGE="$DOCKER_IMAGE_NAMESPACE/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG"
# ------------------------------------------------------------------------------
# Utilities
u:error() {
echo >&2 Error: $@
}
u:error_and_exit() {
error $@
exit 1
}
u:help() {
if [[ $# == 0 ]]; then
cat >&2 << __END__
Usage:
$SCRIPT_NAME command [args]
All arguments to the comcon script are passed directly to
the docker container. The environment inside the container
contains GCC compilers for x86_64, aarch64, arm, and armhf.
Additionally, the container image contains make, cmake, and
ninja for building software.
__END__
fi
}
# ------------------------------------------------------------------------------
# Parse arguments
if [[ $# == 0 ]]; then
u:help
exit 1
fi
# Check if docker is available and the daemon is running
`which docker 1>/dev/null 2>/dev/null` || \
u:error_and_exit "Docker does not seem to be available on the host device."
`docker ps -q 1>/dev/null 2>/dev/null` || \
u:error_and_exit "Docker daemon does not seem to be running."
# Get current host working directory, user and group ids and names
HOST_WD=`/bin/pwd -P`
HOST_UID="$(id -u)"
HOST_GID="$(id -g)"
HOST_USER="$(id -un)"
HOST_GROUP="$(id -gn)"
# If running from tty0, have docker allocate a pseudo-tty (-t)
# and keep stdin open (-i).
# See https://docs.docker.com/engine/reference/run/#foreground
test -t 0 && DOCKER_RUN_ARGS=-it || DOCKER_RUN_ARGS=
# Run the docker container, pass arguments and environment variables
docker run $DOCKER_RUN_ARGS --rm \
-v "$HOST_WD":/workdir \
-e HOST_UID=$HOST_UID \
-e HOST_GID=$HOST_GID \
-e HOST_USER=$HOST_USER \
-e HOST_GROUP=$HOST_GROUP \
$DOCKER_IMAGE \
"$@"
# Exit with the return code of the docker run command above
exit $?
ARG NAMESPACE=tooling
ARG IMAGE_BASE=base
ARG IMAGE_SSH=ssh
ARG IMAGE_TAG=latest
FROM $NAMESPACE/$IMAGE_BASE:$IMAGE_TAG
MAINTAINER Bruno Klopott "klopottb@student.ethz.ch"
# Install the SSH server
RUN apt-get install -q --no-install-recommends --yes \
openssh-server
# Permit root login to SSH
RUN sed -i "s/^(#)?RSAAuthentication.*/RSAAuthentication yes/g" \
/etc/ssh/sshd_config && \
sed -i "s/^(#)?PubkeyAuthentication.*/PubkeyAuthentication yes/g" \
/etc/ssh/sshd_config && \
sed -i "s/^(#)?TCPKeepAlive.*/TCPKeepAlive yes/g" \
/etc/ssh/sshd_config && \
sed -i "s/^(#)?ClientAliveInterval.*/ClientAliveInterval 600/g" \
/etc/ssh/sshd_config && \
sed -i "s/^(#)?PasswordAuthentication.*/PasswordAuthentication yes/g" \
/etc/ssh/sshd_config && \
sed -i "s/^(#)?AuthorizedKeysFile.*/AuthorizedKeysFile\t\.ssh\/authorized_keys/g" \
/etc/ssh/sshd_config && \
sed -i "s/^(#)?PermitRootLogin.*/PermitRootLogin yes/g" \
/etc/ssh/sshd_config && \
sed -i "s/^(#)?PermitEmptyPasswords.*/PermitEmptyPasswords yes/g" \
/etc/ssh/sshd_config
# Create the privilege separation directory
RUN mkdir /var/run/sshd
# Expose the SSH port
EXPOSE 22
# copy toolchains to /tool on the container
COPY toolchains/ /tool
COPY scripts/setup-ssh.sh /setup/
RUN chmod u+x /setup/setup-ssh.sh
CMD /setup/setup-ssh.sh && /usr/sbin/sshd -D
LABEL org.label-schema.name="$NAMESPACE/$IMAGE_SSH" \
org.label-schema.name="A complete environment necessary for cross-compiling C and C++ projects with extended support, exposed via SSH." \
org.label-schema.schema-version="1.0"
set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc-8")
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++-8")
set(CMAKE_C_COMPILER "arm-linux-gnueabi-gcc-8")
set(CMAKE_CXX_COMPILER "arm-linux-gnueabi-g++-8")
set(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc-8")
set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++-8")
set(CMAKE_C_COMPILER "gcc-8")
set(CMAKE_CXX_COMPILER "g++-8")