mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
Fix build by docker compose
This commit is contained in:
parent
20c9919c0c
commit
52ff9fe5e7
2 changed files with 7 additions and 6 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -1,19 +1,19 @@
|
||||||
ARG BASE_IMAGE
|
ARG BASE_IMAGE
|
||||||
|
ARG ROS_DISTRO
|
||||||
|
FROM osrf/ros:${ROS_DISTRO}-desktop-full AS ros_distro
|
||||||
|
|
||||||
FROM ${BASE_IMAGE}
|
FROM ${BASE_IMAGE}
|
||||||
|
ARG ROS_DISTRO
|
||||||
|
|
||||||
# For this build, we pull the entire ros image, and then merge the filesystem
|
# For this build, we pull the entire ros image, and then merge the filesystem
|
||||||
# with the nvidia/opengl image, so that displaying to the screen on GPU
|
# with the nvidia/opengl image, so that displaying to the screen on GPU
|
||||||
# (or without GPU) works through docker.
|
# (or without GPU) works through docker.
|
||||||
# I was unable to use the ROS_DISTRO variable here due to this issue:
|
COPY --from=ros_distro / /
|
||||||
# https://github.com/docker/for-mac/issues/2155
|
|
||||||
COPY --from=osrf/ros:melodic-desktop-full / /
|
|
||||||
|
|
||||||
# Add ROS env vars to the bashrc
|
# Add ROS env vars to the bashrc
|
||||||
ENV BASH_ENV="/root/launch.sh"
|
ENV BASH_ENV="/root/launch.sh"
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
ENTRYPOINT ["/bin/bash", "-c"]
|
ENTRYPOINT ["/bin/bash", "-c"]
|
||||||
ARG ROS_DISTRO
|
|
||||||
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> $BASH_ENV
|
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> $BASH_ENV
|
||||||
|
|
||||||
# Copy myCobot ROS package
|
# Copy myCobot ROS package
|
||||||
|
|
@ -21,8 +21,8 @@ WORKDIR /catkin_ws/src
|
||||||
COPY . mycobot_ros
|
COPY . mycobot_ros
|
||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
|
RUN apt-get update && apt-get install -y curl
|
||||||
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \
|
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
# ROS Build dependencies
|
# ROS Build dependencies
|
||||||
python-rosinstall \
|
python-rosinstall \
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
|
|
||||||
x-app: &common
|
x-app: &common
|
||||||
command: [ "roslaunch mycobot_320 mycobot_320_slider.launch" ]
|
command: [ "roslaunch mycobot_280 slider_control.launch" ]
|
||||||
privileged: true
|
privileged: true
|
||||||
environment:
|
environment:
|
||||||
PYTHONUNBUFFERED: 1
|
PYTHONUNBUFFERED: 1
|
||||||
|
|
@ -9,6 +9,7 @@ x-app: &common
|
||||||
DISPLAY: $DISPLAY
|
DISPLAY: $DISPLAY
|
||||||
volumes:
|
volumes:
|
||||||
- "/tmp/.X11-unix:/tmp/.X11-unix:rw"
|
- "/tmp/.X11-unix:/tmp/.X11-unix:rw"
|
||||||
|
- ".:/catkin_ws/src/mycobot_ros"
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
args: &common-args
|
args: &common-args
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue