forked from BroadbandForum/obuspa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.devel-env
57 lines (50 loc) · 1.32 KB
/
Dockerfile.devel-env
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
#
# file Dockerfile.devel-env
#
# Developer docker image with extras tools to compile and remote debugging
#
# Based on obuspa:build-env stage build from Dockerfile.
#
# Execution lines:
# 1) Create the build environment image
# > docker build -f Dockerfile -t obuspa:build-env --target build-env .
# 2) Create the development image
# > docker build -f Dockerfile.devel-env -t obuspa:devel-env --target devel-env .
#
FROM obuspa:build-env AS devel-env
# Install tools and dependencies for remote dev
RUN apt-get update && apt-get -y install \
build-essential \
gcc \
g++ \
clang \
cmake \
rsync \
tar \
python3 \
ninja-build \
dos2unix \
gdb \
gdb-multiarch \
openssh-server \
&& apt-get clean
# Set-up SSH for remote debug
EXPOSE 22/tcp
RUN useradd -m user && yes password | passwd user
RUN service ssh start
CMD ["/usr/sbin/sshd","-D"]
FROM devel-env AS devel-runner
ENV MAKE_JOBS=8
ENV OBUSPA_ARGS="-v4"
# Copy in all of the code
# Then compile, as root.
COPY . /obuspa/
RUN cd /obuspa/ && \
cmake -B build_folder -S . && \
cmake --build build_folder -j${MAKE_JOBS} && \
cmake --install build_folder
# Then delete the code
# that's no longer needed
RUN rm -rf /obuspa
# Run obuspa with args expanded
CMD obuspa ${OBUSPA_ARGS}