Joel Stanley | a3544a1 | 2015-11-24 00:26:51 +1030 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | Dockerfile=$(cat << EOF |
| 4 | FROM ubuntu:15.10 |
| 5 | RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get upgrade -yy |
| 6 | RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -yy make g++ gcc libsystemd-dev libc6-dev pkg-config |
Patrick Williams | 06736b2 | 2021-04-13 20:35:05 -0500 | [diff] [blame] | 7 | RUN groupadd -g ${GROUPS[0]} ${USER} && useradd -d ${HOME} -m -u ${UID} -g ${GROUPS[0]} ${USER} |
Joel Stanley | a3544a1 | 2015-11-24 00:26:51 +1030 | [diff] [blame] | 8 | USER ${USER} |
| 9 | ENV HOME ${HOME} |
| 10 | RUN /bin/bash |
| 11 | EOF |
| 12 | ) |
| 13 | |
| 14 | docker pull ubuntu:15.10 |
| 15 | docker build -t temp - <<< "${Dockerfile}" |
| 16 | |
| 17 | gcc --version |
| 18 | |
| 19 | docker run --cap-add=sys_admin --net=host --rm=true --user="${USER}" \ |
| 20 | -w "${PWD}" -v "${HOME}":"${HOME}" -t temp make |