-
Notifications
You must be signed in to change notification settings - Fork 1
Add Dockerfile for Selkies project and update build configuration #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
marc-hanheide
wants to merge
10
commits into
main
Choose a base branch
from
selkies
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a29a0de
Add Dockerfile for Selkies project and update build configuration
marc-hanheide c3e670c
Update base image version in Dockerfile and workflow configuration
marc-hanheide 49c9ba0
fix line continuation
marc-hanheide 8591fc6
Update base image in Dockerfile to use linuxserver/baseimage-selkies:…
marc-hanheide a440afa
Update base image in Docker build workflow to use linuxserver/baseima…
marc-hanheide 9ef5f6e
Merge branch 'selkies' of https://github.com/LCAS/docker_cuda_desktop…
marc-hanheide 39aa81d
Update base image in Dockerfile and remove unused dependencies
marc-hanheide 55dbd2b
Comment out unused lines in Dockerfile for clarity
marc-hanheide fbc720c
Remove unused installation steps from Dockerfile and add docker-compo…
marc-hanheide 64fa677
Update base image in Docker build workflow to use lscr.io/linuxserver…
marc-hanheide File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| ARG BASE_IMAGE=ghcr.io/selkies-project/nvidia-egl-desktop:24.04 | ||
|
|
||
| ########################################### | ||
| FROM ${BASE_IMAGE} AS base | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Install language | ||
| RUN apt-get update ; \ | ||
| apt-get upgrade -y && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| locales \ | ||
| && locale-gen en_US.UTF-8 \ | ||
| && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| ENV LANG=en_US.UTF-8 | ||
|
|
||
| # Install timezone | ||
| RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime \ | ||
| && export DEBIAN_FRONTEND=noninteractive \ | ||
| && apt-get update ; \ | ||
| apt-get install -y --no-install-recommends tzdata \ | ||
| && dpkg-reconfigure --frontend noninteractive tzdata \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN apt-get update; apt-get -y upgrade \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Install common programs | ||
| RUN apt-get update; apt-get install -y --no-install-recommends \ | ||
| curl \ | ||
| gnupg2 \ | ||
| lsb-release \ | ||
| git \ | ||
| nano \ | ||
| sudo \ | ||
| python3-setuptools \ | ||
| software-properties-common \ | ||
| wget \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg | ||
|
|
||
| # Prepare ROS2 | ||
| RUN add-apt-repository universe \ | ||
| && curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \ | ||
| && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null | ||
|
|
||
| ################ | ||
| # Expose the nvidia driver to allow opengl | ||
| # Dependencies for glvnd and X11. | ||
| ################ | ||
| RUN apt-get update \ | ||
| && apt-get install -y -qq --no-install-recommends \ | ||
| libglvnd0 \ | ||
| libgl1 \ | ||
| libglx0 \ | ||
| libegl1 \ | ||
| libxext6 \ | ||
| libx11-6 \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Env vars for the nvidia-container-runtime. | ||
| ENV NVIDIA_VISIBLE_DEVICES=all | ||
| # enable all capabilities for the container | ||
| # Explained here: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.10.0/user-guide.html#driver-capabilities | ||
| ENV NVIDIA_DRIVER_CAPABILITIES=all | ||
| ENV QT_X11_NO_MITSHM=1 | ||
|
|
||
|
|
||
| ARG USERNAME=ros | ||
| ARG USER_UID=1001 | ||
| ARG USER_GID=$USER_UID | ||
|
|
||
| # Create a non-root user | ||
| RUN groupadd --gid $USER_GID $USERNAME \ | ||
| && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
| # Add sudo support for the non-root user | ||
| && apt-get update \ | ||
| && apt-get install -y --no-install-recommends sudo \ | ||
| && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ | ||
marc-hanheide marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| && chmod 0440 /etc/sudoers.d/$USERNAME \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
|
|
||
| ########################################### | ||
| FROM base AS lcas | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y lsb-release curl software-properties-common unzip apt-transport-https && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN sh -c 'echo "deb https://lcas.lincoln.ac.uk/apt/lcas $(lsb_release -sc) lcas" > /etc/apt/sources.list.d/lcas-latest.list' && \ | ||
| curl -s https://lcas.lincoln.ac.uk/apt/repo_signing.gpg > /etc/apt/trusted.gpg.d/lcas-latest.gpg | ||
|
|
||
| RUN mkdir -p /etc/ros/rosdep/sources.list.d/ && \ | ||
| curl -o /etc/ros/rosdep/sources.list.d/20-default.list https://raw.githubusercontent.com/LCAS/rosdistro/master/rosdep/sources.list.d/20-default.list && \ | ||
| curl -o /etc/ros/rosdep/sources.list.d/50-lcas.list https://raw.githubusercontent.com/LCAS/rosdistro/master/rosdep/sources.list.d/50-lcas.list | ||
|
|
||
| ENV ROSDISTRO_INDEX_URL=https://raw.github.com/LCAS/rosdistro/master/index-v4.yaml | ||
|
|
||
| ENV ZENOH_BRIDGE_VERSION=1.3.2 | ||
| RUN cd /tmp; \ | ||
| if [ "$(dpkg --print-architecture)" = "arm64" ]; then \ | ||
| curl -L -O https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds/releases/download/${ZENOH_BRIDGE_VERSION}/zenoh-plugin-ros2dds-${ZENOH_BRIDGE_VERSION}-aarch64-unknown-linux-gnu-standalone.zip; \ | ||
| else \ | ||
| curl -L -O https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds/releases/download/${ZENOH_BRIDGE_VERSION}/zenoh-plugin-ros2dds-${ZENOH_BRIDGE_VERSION}-x86_64-unknown-linux-gnu-standalone.zip; \ | ||
| fi; \ | ||
| unzip zenoh-plugin-ros2dds-*.zip && \ | ||
| mv zenoh-bridge-ros2dds /usr/local/bin/ && \ | ||
| chmod +x /usr/local/bin/zenoh-bridge-ros2dds && \ | ||
| ldconfig && \ | ||
| rm -rf zenoh-* | ||
|
|
||
| # install nodejs | ||
| RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - | ||
| RUN apt-get update && apt-get install -y nodejs sudo && \ | ||
| apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
|
|
||
| ########################################### | ||
| FROM lcas AS user | ||
| USER ros | ||
| ENV HOME=/home/ros | ||
| WORKDIR ${HOME} | ||
| RUN mkdir -p ${HOME}/.local/bin | ||
|
|
||
| USER root | ||
| COPY .gi? /tmp/gittemp/.git | ||
marc-hanheide marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| RUN git -C /tmp/gittemp log -n 1 --pretty=format:"%H" > /opt/image/version | ||
|
|
||
| RUN echo "# Welcome to the L-CAS Desktop Container.\n" > /opt/image/info.md; \ | ||
| echo "This is a Virtual Desktop provided by [L-CAS](https://lcas.lincoln.ac.uk/)." >> /opt/image/info.md; \ | ||
| echo "\n" >> /opt/image/info.md; \ | ||
| echo "*built from https://github.com/LCAS/ros-docker-images\n(commit: [\`$(cat /opt/image/version)\`](https://github.com/LCAS/ros-docker-images/tree/$(cat /opt/image/version)/)),\nprovided to you by [L-CAS](https://lcas.lincoln.ac.uk/).*" >> /opt/image/info.md; \ | ||
| echo "\n" >> /opt/image/info.md; \ | ||
| echo "## Installed Software\n" >> /opt/image/info.md; \ | ||
| echo "The following software is installed:" >> /opt/image/info.md; \ | ||
| echo "* The L-CAS ROS2 [apt repositories](https://lcas.lincoln.ac.uk/apt/lcas) are enabled." >> /opt/image/info.md; \ | ||
| echo "* The L-CAS [rosdistro](https://github.com/LCAS/rosdistro) is enabled." >> /opt/image/info.md; \ | ||
| echo "* The Zenoh ROS2 bridge \`zenoh-bridge-ros2dds\` (version: ${ZENOH_BRIDGE_VERSION})." >> /opt/image/info.md; \ | ||
| echo "* Node.js (with npm) in version $(node --version)." >> /opt/image/info.md; \ | ||
| echo "* password-less \`sudo\` to install more packages." >> /opt/image/info.md; \ | ||
| echo "\n" >> /opt/image/info.md; \ | ||
| echo "## Default Environment\n" >> /opt/image/info.md; \ | ||
| echo "The following environment variables are set by default:" >> /opt/image/info.md; \ | ||
| echo '```' >> /opt/image/info.md; \ | ||
| env >> /opt/image/info.md; \ | ||
| echo '```' >> /opt/image/info.md; \ | ||
| chmod -w /opt/image/info.md | ||
| COPY README.md /opt/image/README.md | ||
|
|
||
| USER ros | ||
|
|
||
| RUN mkdir -p ${HOME}/Desktop/ && \ | ||
| ln -s /opt/image/info.md ${HOME}/Desktop/info.md && \ | ||
| ln -s /opt/image/README.md ${HOME}/Desktop/README.md | ||
|
|
||
| RUN mkdir -p ~/.config/rosdistro && echo "index_url: https://raw.github.com/LCAS/rosdistro/master/index-v4.yaml" > ~/.config/rosdistro/config.yaml | ||
|
|
||
| ENV SHELL=/bin/bash | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.