Skip to content

Commit

Permalink
add rk3588 docker with ros2 humble
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylorchen committed Jul 1, 2024
1 parent 5518e05 commit 6832490
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-ubuntu-3588-rootfs-ros2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and push multi-arch ubuntu-3588-rootfs Docker image

on:
push:
paths:
- 'ubuntu-3588-rootfs/Dockerfile_ROS2'
pull_request:
paths:
- 'ubuntu-3588-rootfs/Dockerfile_ROS2'

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Copy files
run: |
cp ubuntu-3588-rootfs/kaylor-keyring.gpg ./
cp ubuntu-3588-rootfs/rk3588-kaylor.list ./
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ubuntu-3588-rootfs/Dockerfile_ROS2
push: true
tags: kaylor/ubuntu-3588-rootfs:humble-ros-base-jammy
platforms: linux/arm64

- name: Logout of DockerHub
run: docker logout
33 changes: 33 additions & 0 deletions ubuntu-3588-rootfs/Dockerfile_ROS2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Version 1.0
FROM ros:humble-ros-base-jammy

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
# 维护者
LABEL maintainer="[email protected]"

RUN sed -i "s/ports.ubuntu.com/mirrors.cloud.tencent.com/g" /etc/apt/sources.list

COPY kaylor-keyring.gpg /etc/apt/keyrings/
COPY rk3588-kaylor.list /etc/apt/sources.list.d/

RUN apt update && apt install -y --no-install-recommends gcc g++ cmake openssh-server && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
echo "PermitRootLogin yes" | tee -a /etc/ssh/sshd_config

RUN echo 'root:root' | chpasswd

RUN apt update && apt install -y --no-install-recommends vim libopencv-dev g++ gcc \
fakeroot devscripts libspdlog-dev libsystemd-dev libcap-dev liblz4-dev \
libgcrypt-dev libzstd-dev debhelper rknpu2-dev librockchip-mpp-dev librga-dev \
libstb-dev libturbojpeg0-dev libjpeg-turbo8-dev librga2 libboost-dev \
libboost-system1.74-dev kaylordut-dev libbytetrack && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# 设置当容器启动时自动运行 SSH 服务
# 使用 init 脚本启动 SSH 服务
CMD ["/etc/init.d/ssh", "start"]

# 因为 `ssh start` 命令会执行完毕后退出,我们需要一个持续运行的前台进程
# 可以通过让 bash 在前台无限运行来做到这一点
CMD ["bash", "-c", "service ssh start; while true; do sleep 30; done;"]

0 comments on commit 6832490

Please sign in to comment.