Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
Added arm64 cockerfile and changed names of both dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
vortex authored and EirikKolas committed Sep 24, 2023
1 parent e60ea98 commit 4fbf4d8
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 42 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Publish Docker image to ghcr

on:
push:
branches: [ main ]
workflow_dispatch:

pull_request:
types: [opened, reopened]
branches: [ main ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
architecture:
- amd64
- arm64
filename:
- ros2
- ros2-cuda

permissions:
contents: read
packages: write

steps:
- name: Checkout own repository
uses: actions/checkout@v4

- name: Set up QEMU
if: matrix.architecture != 'amd64'
uses: docker/setup-qemu-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.filename }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.${{ matrix.filename }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.filename }}:${{ matrix.architecture }}-latest
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
45 changes: 3 additions & 42 deletions Dockerfile.ros2
Original file line number Diff line number Diff line change
@@ -1,46 +1,7 @@
FROM nvidia/cuda:12.2.0-base-ubuntu22.04

ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Install necessary software for the installation of ROS2
RUN apt-get update && apt-get install -y \
locales \
curl \
gnupg2 \
lsb-release \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*rm

# install packages
RUN apt-get update || true && apt-get install -q -y --no-install-recommends \
bash-completion \
dirmngr \
gnupg2 \
lsb-release \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

# install ros2 humble base

RUN apt-get update

RUN apt install software-properties-common -y
RUN add-apt-repository universe

RUN apt update && apt install curl -y
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

RUN 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

RUN apt update && apt upgrade -y

RUN apt install -y ros-humble-ros-base \
python3-colcon-common-extensions \
python3-rosdep \
python3-argcomplete \
&& rm -rf /var/lib/apt/lists/*rm
FROM ros:humble

# add sourcing to shell startup script

RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc

#
46 changes: 46 additions & 0 deletions Dockerfile.ros2-cuda
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM nvidia/cuda:12.2.0-base-ubuntu22.04

ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Install necessary software for the installation of ROS2
RUN apt-get update && apt-get install -y \
locales \
curl \
gnupg2 \
lsb-release \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*rm

# install packages
RUN apt-get update || true && apt-get install -q -y --no-install-recommends \
bash-completion \
dirmngr \
gnupg2 \
lsb-release \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

# install ros2 humble base

RUN apt-get update

RUN apt install software-properties-common -y
RUN add-apt-repository universe

RUN apt update && apt install curl -y
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

RUN 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

RUN apt update && apt upgrade -y

RUN apt install -y ros-humble-ros-base \
python3-colcon-common-extensions \
python3-rosdep \
python3-argcomplete \
&& rm -rf /var/lib/apt/lists/*rm

# add sourcing to shell startup script

RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc

0 comments on commit 4fbf4d8

Please sign in to comment.