Skip to content

Commit

Permalink
support apple silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
woensug-choi committed Jun 5, 2024
1 parent 13f54b0 commit 3e8c848
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 1 deletion.
File renamed without changes.
50 changes: 50 additions & 0 deletions .docker/jazzy.arm64v8.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ARG ROS_DISTRO="jazzy"
FROM arm64v8/ubuntu:24.04
ARG BRANCH="ros2"

# update and upgrade libs
RUN apt-get update \
&& apt-get -y upgrade \
&& rm -rf /tmp/*

# Install basics
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
# hadolint ignore=DL3008
RUN apt-get install -y --no-install-recommends \
sudo tzdata build-essential gfortran automake \
bison flex libtool git wget locales \
software-properties-common

# Locale for UTF-8
RUN locale-gen en_US en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
export LANG=en_US.UTF-8

# Install Utilities
# hadolint ignore=DL3008
RUN apt-get -y install --no-install-recommends \
x11-apps mesa-utils xauth \
&& rm -rf /tmp/*

ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\
extras/ros-jazzy-gz-harmonic-install.sh install.sh
RUN bash install.sh

ENV ROS_UNDERLAY /root/ws_dave/install
WORKDIR $ROS_UNDERLAY/../src

ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\
extras/repos/dave.$ROS_DISTRO.repos dave.repos
RUN vcs import < dave.repos

RUN apt-get update && rosdep update && \
rosdep install -iy --from-paths . && \
rm -rf /var/lib/apt/lists/

WORKDIR $ROS_UNDERLAY/..
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
colcon build

# source entrypoint setup
RUN sed --in-place --expression \
'$i source "$ROS_UNDERLAY/setup.bash"' /ros_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: .docker/jazzy.dockerfile
file: .docker/jazzy.amd64.dockerfile
build-args: |
ROS_DISTRO=${{ env.ROS_DISTRO }}
BRANCH=${{ env.BRANCH }}
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/docker-arm64v8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: Create and publish a Docker image

# yamllint disable-line rule:truthy
on:
push:
tags: ["*"]
branches:
- ros2

env:
IMAGE_NAME: ${{ github.repository }}
ROS_DISTRO: jazzy
BRANCH: ros2

jobs:
build-and-push-to-docker-hub:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

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

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

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: woensugchoi/dave
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: .docker/jazzy.arm64v8.dockerfile
build-args: |
ROS_DISTRO=${{ env.ROS_DISTRO }}
BRANCH=${{ env.BRANCH }}
- name: Debug environment variables
run: |
echo "ROS_DISTRO: ${ROS_DISTRO}"
echo "BRANCH: ${BRANCH}"

0 comments on commit 3e8c848

Please sign in to comment.