|
| 1 | +FROM ubuntu:24.04 |
| 2 | + |
| 3 | +ARG CMAKE_VERSION=3.31.8 |
| 4 | +ARG TZ=America/Los_Angeles |
| 5 | +ENV DEBIAN_FRONTEND=noninteractive |
| 6 | +ARG USER_NAME="Joel Winarske" |
| 7 | +ARG USER_EMAIL="joel.winarske@gmail.com" |
| 8 | +ARG RUNNER_USER_UID=1001 |
| 9 | +ARG DOCKER_GROUP_GID=121 |
| 10 | + |
| 11 | +USER root |
| 12 | + |
| 13 | +RUN apt-get update -y |
| 14 | +RUN apt-get install -y apt-utils |
| 15 | + |
| 16 | +RUN apt-get update -y |
| 17 | +RUN apt-get upgrade -y |
| 18 | + |
| 19 | +RUN apt-get install -y \ |
| 20 | + curl lsb-release software-properties-common gnupg apt-file \ |
| 21 | + build-essential libtool chrpath cpio debianutils diffstat file \ |
| 22 | + gawk gcc git iputils-ping libacl1 locales python3 python3-git \ |
| 23 | + python3-jinja2 python3-pexpect python3-pip python3-subunit socat \ |
| 24 | + texinfo unzip wget xz-utils zstd lz4 |
| 25 | + |
| 26 | +# Desktop specific |
| 27 | + |
| 28 | +# clang 18 |
| 29 | +RUN wget https://apt.llvm.org/llvm.sh |
| 30 | +RUN chmod +x llvm.sh |
| 31 | +RUN ./llvm.sh 18 all |
| 32 | + |
| 33 | +RUN apt-get install -y libwayland-dev wayland-protocols \ |
| 34 | + mesa-common-dev libegl1-mesa-dev libgles2-mesa-dev \ |
| 35 | + mesa-utils libcurl4-openssl-dev libjpeg-turbo8-dev \ |
| 36 | + libpng-dev libsqlite3-dev libssl-dev libfreetype6-dev \ |
| 37 | + libharfbuzz-dev libxi-dev libunwind-dev ninja-build |
| 38 | + |
| 39 | +# Runner user |
| 40 | +RUN adduser --disabled-password --gecos '' -u $RUNNER_USER_UID dev \ |
| 41 | + && groupadd docker --gid $DOCKER_GROUP_GID \ |
| 42 | + && usermod -aG sudo dev \ |
| 43 | + && usermod -aG docker dev \ |
| 44 | + && echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \ |
| 45 | + && echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers |
| 46 | + |
| 47 | +RUN chown -R dev:dev /home/dev |
| 48 | + |
| 49 | +RUN locale-gen en_US.UTF-8 |
| 50 | +ENV LANG=en_US.UTF-8 |
| 51 | + |
| 52 | +RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash |
| 53 | +RUN apt-get update && apt-get install -y git-lfs |
| 54 | + |
| 55 | +USER dev |
| 56 | + |
| 57 | +WORKDIR /home/dev |
| 58 | + |
| 59 | +RUN echo '/home/dev/.ssh/id_rsa' | ssh-keygen -t rsa -b 2048 -C "${USER_EMAIL}" |
| 60 | +RUN git config --global user.email ${USER_EMAIL} |
| 61 | +RUN git config --global user.name "${USER_NAME}" |
| 62 | + |
| 63 | +RUN set -ex \ |
| 64 | + && for key in C6C265324BBEBDC350B513D02D2CEF1034921684; do \ |
| 65 | + gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ |
| 66 | + done |
| 67 | + |
| 68 | +# install for python 3 |
| 69 | +RUN set -ex \ |
| 70 | + && mkdir -p /home/dev/bin \ |
| 71 | + && export PATH=/home/dev/bin:$PATH \ |
| 72 | + && curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo \ |
| 73 | + && chmod a+x /home/dev/bin/repo |
| 74 | + |
| 75 | +RUN curl -fsSLO --compressed --retry 5 --retry-max-time 120 https://cmake.org/files/v3.31/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz \ |
| 76 | + && curl -fsSLO --compressed --retry 5 --retry-max-time 120 https://cmake.org/files/v3.31/cmake-${CMAKE_VERSION}-SHA-256.txt.asc \ |
| 77 | + && curl -fsSLO --compressed --retry 5 --retry-max-time 120 https://cmake.org/files/v3.31/cmake-${CMAKE_VERSION}-SHA-256.txt \ |
| 78 | + && gpg --verify cmake-${CMAKE_VERSION}-SHA-256.txt.asc cmake-${CMAKE_VERSION}-SHA-256.txt \ |
| 79 | + && grep "cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz\$" cmake-${CMAKE_VERSION}-SHA-256.txt | sha256sum -c - \ |
| 80 | + && mkdir -p /home/dev/cmake \ |
| 81 | + && tar xzf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz -C /home/dev/cmake --strip-components=1 \ |
| 82 | + && rm -rf cmake-${CMAKE_VERSION}* || true |
| 83 | + |
| 84 | +RUN echo 'export PATH=/home/dev/bin:/home/dev/cmake/bin:$PATH' >> /home/dev/.bashrc |
0 commit comments