-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.armv8-dev
More file actions
81 lines (68 loc) · 2.88 KB
/
Dockerfile.armv8-dev
File metadata and controls
81 lines (68 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# ARMv8 development DUA base unit.
#
# Roberto Masocco <r.masocco@dotxautomation.com>
#
# March 4, 2023
# Copyright 2025 dotX Automation s.r.l.
#
# 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.
# Start from an linux/arm64/v8 Ubuntu 24.04 image
FROM --platform=linux/arm64/v8 ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Configure environment
ENV CARGO_HOME=/opt/rust
ENV CMAKE_PREFIX_PATH=/usr/local
ENV LANG=en_US.UTF-8
ENV MEDIAMTX_ARCH=arm64
ENV MEDIAMTX_VERSION=v1.15.6
ENV PATH=/opt/dds/Fast-DDS/src/fastddsgen/scripts:/opt/dds/cyclonedds/install/bin:$PATH
ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp
ENV RUSTUP_HOME=/opt/rust
# Copy setup files
COPY scripts/armv8-dev /opt/scripts
# Execute first stage
RUN /opt/scripts/stage1.sh
# Create a Python virtual environment and install packages in it
RUN --mount=type=bind,source=scripts/python/requirements.txt,target=/opt/requirements.txt --mount=type=bind,source=scripts/python/requirements_dev.txt,target=/opt/requirements_dev.txt \
python3 -m venv --system-site-packages /opt/dua-venv && \
. /opt/dua-venv/bin/activate && \
pip install -U -r /opt/requirements.txt -r /opt/requirements_dev.txt && \
chgrp -R internal /opt/dua-venv && \
chmod -R g+rw /opt/dua-venv
# Ensure that the Python environment is correctly sourced
# System path is the output of:
# python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
ENV PYTHONPATH=/opt/dua-venv/lib/python3.12/site-packages:/usr/lib/python3/dist-packages
# Execute second stage
RUN /opt/scripts/stage2.sh
# Build and install dua-utils
# The ARG allows us to break cache and rebuild from here upon each new version
ARG DUA_UTILS_VERSION=20260426-1025
COPY scripts/ros2/build_dua_utils.sh /opt/build_dua_utils.sh
COPY scripts/ros2/dua-utils_repos_dev.yaml /opt/dua-utils_repos_dev.yaml
RUN . /opt/dua-venv/bin/activate && \
/opt/build_dua_utils.sh jazzy /opt/dua-utils_repos_dev.yaml && \
chgrp internal /opt/build_dua_utils.sh && \
chmod g+rwx /opt/build_dua_utils.sh && \
chgrp internal /opt/dua-utils_repos_dev.yaml && \
chmod g+rw /opt/dua-utils_repos_dev.yaml && \
chgrp -R internal /opt/ros/dua-utils && \
chmod -R g+rw /opt/ros/dua-utils
# Mark image as complete
RUN mkdir -p /etc/dua && \
echo "armv8-dev" > /etc/dua/target
ENV DEBIAN_FRONTEND=dialog
# Finalize image
LABEL description="DUA base unit for aarch64 development systems"
LABEL platform="linux/arm64/v8"
CMD ["bash"]