Skip to content

Commit a257afd

Browse files
committed
re-enable VNC server and clean up entry point
1 parent 7e1c3ac commit a257afd

File tree

2 files changed

+13
-35
lines changed

2 files changed

+13
-35
lines changed

Dockerfile.devel

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,27 @@ ADD ./bash_completion /home/$USERNAME/.bash_completion
3636
RUN mkdir -p /home/$USERNAME/.bash_completion.d
3737

3838

39+
# Adjust $USERNAME home directory permissions
40+
USER root
41+
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME
42+
3943
# Switch to 'user' context
4044
USER $USERNAME
4145

4246
# Configure environment variables
43-
# ENV DISPLAY=:0
47+
ENV DISPLAY=:0
4448
ENV ZEPHYR_BASE=/workdir/zephyr
4549

4650
# Set working directory
4751
WORKDIR /workdir
4852
VOLUME ["/workdir"]
4953

5054
# Configure VNC authentication
51-
# ARG VNCPASSWD=zephyr
52-
# RUN mkdir ~/.vnc && x11vnc -storepasswd ${VNCPASSWD} ~/.vnc/passwd
55+
ARG VNCPASSWD=zephyr
56+
RUN mkdir ~/.vnc && x11vnc -storepasswd ${VNCPASSWD} ~/.vnc/passwd
5357

5458
# Expose port 5900 for VNC
55-
# EXPOSE 5900
56-
57-
# Adjust $USERNAME home directory permissions
58-
USER root
59-
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME
60-
61-
# Make 'user' default on launch
62-
USER $USERNAME
59+
EXPOSE 5900
6360

6461
# Launch bash shell by default
6562
CMD ["/bin/bash"]

entrypoint.sh

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
1-
#!/bin/dash
1+
#!/bin/bash
22

3-
# SNUM=$(echo $DISPLAY | sed 's/:\([0-9][0-9]*\)/\1/')
4-
# xvfb-run -n $SNUM -s "-screen 0 1024x768x24" -f ~/.Xauthority openbox-session &
5-
# sleep 1
6-
# x11vnc -display $DISPLAY -usepw -forever -quiet &
3+
SNUM=$(echo $DISPLAY | sed 's/:\([0-9][0-9]*\)/\1/')
4+
xvfb-run -n $SNUM -s "-screen 0 1024x768x24" -f ~/.Xauthority openbox-session &
5+
sleep 1
6+
x11vnc -display $DISPLAY -usepw -forever -quiet &
77

8-
sudo chown $(id -u) /workdir
9-
sudo chgrp $(id -g) /workdir
10-
11-
# this assumes the usb dongle of interest is located on bus 0 and device 3
12-
# if not this should me modified to match (or can be run manually once the
13-
# container is started)
14-
if [ -c "/dev/bus/usb/001/003" ]; then
15-
echo "USB device detected at bus 001, device 003 Changing permissions"
16-
sudo chmod 0666 /dev/bus/usb/001/003
17-
fi
18-
19-
# check to see if the STM32 Cube programmer is installed, and if it is
20-
# then append it to the PATH
21-
# can be downloaded from
22-
# https://www.st.com/en/development-tools/stm32cubeprog.html
23-
if [ -d "/home/$USER/st/stm32cubeclt_1.17.0/STM32CubeProgrammer" ]; then
24-
echo "Adding the STM32 Cube Programmer to the path"
25-
export PATH=$PATH:/home/$USER/st/stm32cubeclt_1.17.0/STM32CubeProgrammer/bin
26-
fi
278

289
exec "$@"

0 commit comments

Comments
 (0)