forked from zephyrproject-rtos/docker-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.user
70 lines (56 loc) · 1.59 KB
/
Dockerfile.user
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
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-mrlisdim/zephyr_base_container:latest}
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install --no-install-recommends -y \
clang-tidy \
clang-format \
openbox \
python-xdg \
# Needed for guiconfig displaying
python3-tk \
libpython3.8-dev \
x11vnc \
xvfb \
xterm \
xz-utils
# CMake formating tool
RUN pip3 install cmake-format
# Install JLink debugging tools
ARG JLINK_DEB=JLink_Linux_x86_64.deb
RUN wget ${WGET_ARGS} \
--post-data 'accept_license_agreement=accepted&non_emb_ctr=confirmed' \
https://www.segger.com/downloads/jlink/${JLINK_DEB} \
&& apt install -y $(pwd)/${JLINK_DEB} \
&& rm $(pwd)/${JLINK_DEB}
# Clean up stale packages
RUN apt-get clean -y && \
apt-get autoremove --purge -y && \
rm -rf /var/lib/apt/lists/*
# Add entrypoint script
ADD ./entrypoint.sh /home/user/entrypoint.sh
RUN dos2unix /home/user/entrypoint.sh
ENTRYPOINT ["/home/user/entrypoint.sh"]
# Add bash completion script
ADD ./bash_completion /home/user/.bash_completion
RUN mkdir -p /home/user/.bash_completion.d
# Switch to 'user' context
USER user
# Configure environment variables
ENV DISPLAY=host.docker.internal:0
ENV ZEPHYR_BASE=/workdir/zephyr
# Set working directory
WORKDIR /workdir
VOLUME ["/workdir"]
# Configure VNC authentication
ARG VNCPASSWD=zephyr
RUN mkdir ~/.vnc && x11vnc -storepasswd ${VNCPASSWD} ~/.vnc/passwd
# Expose port 5900 for VNC
EXPOSE 5900
# Adjust 'user' home directory permissions
USER root
RUN chown -R user:user /home/user
# Make 'user' default on launch
USER user
# Launch bash shell by default
CMD ["/bin/bash"]