执行以下命令
将原网址
html
raw.githubusercontent.com
替换为
html
raw.gitmirror.com
ubuntu@ubuntu-virtual-machine:~/vxworks/vxworks7-ros2-build/Docker/22.04/vxros2build$ vi Dockerfile
FROM vxbuild:22.04
# Environment variables
ARG ROS_DISTRO=humble
ENV ROS_DISTRO ${ROS_DISTRO}
ENV ROS2_WS /opt/ros2_ws
## Let the script create the workspace
## ENV PRJ_WS_NAME ${BSP}_${BOARD}_${PRJ}_ws
# Set timezone to UTC
RUN echo 'Etc/UTC' > /etc/timezone && \
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*
# Install packages needed for ROS 2 builds
RUN apt-get update && apt install -q -y \
software-properties-common \
curl \
&& add-apt-repository universe \
&& rm -rf /var/lib/apt/lists/*
# Setup Keys
RUN curl -sSL https://raw.gitmirror.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
# Setup sources.list
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
# Setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# Install bootstrap tools
RUN apt-get update && apt -y upgrade \
&& apt install --no-install-recommends -y \
ros-${ROS_DISTRO}-ros-base \
ros-dev-tools \
autoconf automake libtool libltdl-dev mercurial \
&& rm -rf /var/lib/apt/lists/*
# Missing tools for the native ROS 2 build
RUN apt-get update \
&& apt install --no-install-recommends -y \
libacl1-dev libasio-dev liblttng-ust-dev \
&& rm -rf /var/lib/apt/lists/*
/home/ubuntu/vxworks/vxworks7-ros2-build/pkg/ros2/Makefile
# Makefile - for ros2
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# modification history
# --------------------
# 15nov19,rcw created
# 12mar18,akh created
#
# SYNOPSIS automate the build of ROS 2
include $(WIND_USR_MK)/defs.common.mk
include $(WIND_USR_MK)/defs.packages.mk
include $(WIND_USR_MK)/defs.crossbuild.mk
PACKAGES += ros2
PKG_NAME = ros2
PKG_VER = $(ROS_DISTRO)
PKG_URL = https://github.com/Wind-River/vxworks7-layer-for-ros2.git
# layer branch is calculated as $(ROS_DISTRO)-release-$(WIND_RELEASE_ID)
ifeq ($(ROS_DISTRO),rolling)
PKG_COMMIT_ID = $(ROS_DISTRO)-$(WIND_RELEASE_ID)
PKG_REPO_COMMIT_ID = $(ROS_DISTRO)
else
PKG_COMMIT_ID = $(ROS_DISTRO)-release-$(WIND_RELEASE_ID)
PKG_REPO_COMMIT_ID = $(ROS_DISTRO)-release
endif
PKG_TYPE = git
PKG_REPO_URL = https://raw.gitmirror.com/ros2/ros2/${PKG_REPO_COMMIT_ID}/${PKG_NAME}.repos
PKG_LICENSE = BSD
PKG_BUILD_DIR = ros2_ws
PKG_SRC_DIR = patchesS
PKG_BUILD_TYPE := Debug
include $(PACKAGE_DIR)/ros2/files/$(ROS_DISTRO)/packages.mk