forked from nasa/OnAIR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
71 lines (54 loc) · 1.95 KB
/
Dockerfile
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
FROM ubuntu:20.04
ARG USER_ID
ARG GROUP_ID
# Needed for a silent cmake install
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/New_York
# Add the host's user/group ID so that the host can easily access files created by the guest
# Checks if group_id already exists (thanks Romeo)
RUN if ! grep -q ${GROUP_ID} /etc/group ; then groupadd -g ${GROUP_ID} dev_user; fi
RUN useradd -l -u ${USER_ID} -g ${GROUP_ID} onair_dev
# Add a home directory for the user
RUN mkdir /home/onair_dev && \
chown onair_dev /home/onair_dev
# TODO: add ssh with X forwarding
# Install
RUN \
apt-get update && \
apt-get -y upgrade
# Bare minimum to build/run cFS
RUN \
apt-get install sudo && \
apt-get install -y build-essential && \
apt-get install -y gcc-multilib && \
apt-get install -y git && \
apt-get install -y cmake && \
apt-get install -y xterm
# lcov: needed for cFS unit tests
# xxd: does hex dumps, just plain handy to have
RUN \
apt-get install -y lcov && \
apt-get install -y xxd
# OnAIR Dependencies
RUN \
apt-get install -y python3.9 && \
apt-get install -y python3.9-dev && \
apt-get install -y python3-pip
# Add new packages to install here to prevent re-running previous instructions
# Ensure that all packages are up to date after new packages have been added above
RUN \
apt-get update && \
apt-get -y upgrade && \
rm -rf /var/lib/apt/lists/*
# Add user to sudoers so that they can up the mqueue depth
RUN adduser onair_dev sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Make OnAir requirements file accessible by onair_dev user
COPY requirements_pip.txt /home/onair_dev/requirements_onair.txt
RUN chown onair_dev /home/onair_dev/requirements_onair.txt
USER onair_dev
# Python stuff is being installed for the local user
ENV PATH="${PATH}:/home/onair_dev/.local/bin"
# Install OnAIR deps
RUN python3.9 -m pip install --upgrade pip setuptools wheel
RUN python3.9 -m pip install --user -r /home/onair_dev/requirements_onair.txt