-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile-arm64_cross
73 lines (65 loc) · 2.02 KB
/
Dockerfile-arm64_cross
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
# Do not publish to dockerhub
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get --yes update \
&& apt-get --yes install \
nano \
git \
wget \
curl \
unzip \
locales \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
sudo \
build-essential \
swig \
cmake \
openjdk-17-jdk \
gcc-aarch64-linux-gnu \
binutils-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
&& rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
ENV PATH=$PATH:$JAVA_HOME/bin
# Installing SOEM
WORKDIR /opt
RUN git clone https://github.com/OpenEtherCATsociety/SOEM.git
WORKDIR /opt/SOEM
RUN git checkout v1.4.0
RUN mkdir build && cd build
WORKDIR /opt/SOEM/build
RUN cmake -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
-DCMAKE_FIND_ROOT_PATH=/usr/aarch64-linux-gnu \
-DCMAKE_PROGRAM_PATH=/usr/aarch64-linux-gnu/bin \
-DHOST_INSTALL="" -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_POSITION_INDEPENDENT_CODE=true \
-DCMAKE_BUILD_TYPE=Release \
..
RUN make
RUN make install
# Setup a robotlab user as the development user, to avoid using root.
# Allows using sudo with robotlab user without a password.
RUN addgroup robotlab \
&& adduser --uid 1000 --gid 1000 --home /home/robotlab --disabled-password robotlab \
&& chown -R robotlab /home/robotlab \
&& adduser robotlab sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER robotlab
WORKDIR /home/robotlab
RUN mkdir -p /home/robotlab/dev/ihmc-ethercat-master/build
RUN mkdir -p /home/robotlab/dev/ihmc-ethercat-master/src
RUN mkdir -p /home/robotlab/dev/ihmc-ethercat-master/swig
VOLUME /home/robotlab/dev/ihmc-ethercat-master/build
VOLUME /home/robotlab/dev/ihmc-ethercat-master/src
VOLUME /home/robotlab/dev/ihmc-ethercat-master/swig
WORKDIR /home/robotlab/dev/ihmc-ethercat-master
ENTRYPOINT ["/bin/bash"]
CMD ["build-arm64_cross.sh"]