Merge 70f882a766 into bd02bd87f3
This commit is contained in:
commit
babbc66172
|
|
@ -48,6 +48,34 @@ RUN apt-get update \
|
|||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /var/cache/apt/* /tmp/a.txt /tmp/b.txt
|
||||
|
||||
# start installing Yocto base host packages, git, tar, python
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends git tar python3
|
||||
|
||||
# now install additional yocto base host packages
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends gawk wget git-core diffstat unzip texinfo gcc-multilib \
|
||||
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
|
||||
xz-utils debianutils iputils-ping libsdl1.2-dev xterm
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
# now install from the NXP i.MX recommended yocto packages
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends gawk wget git-core diffstat unzip texinfo gcc-multilib \
|
||||
build-essential chrpath socat libsdl1.2-dev libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
|
||||
docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
|
||||
libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
# now install uboot tools from NXP i.MX recommended yocto packages
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends u-boot-tools
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
# now install emacs
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends emacs
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
|
||||
################################################################################
|
||||
# builder
|
||||
|
|
@ -76,7 +104,6 @@ RUN cd /src/web \
|
|||
&& yarn \
|
||||
&& npm run build
|
||||
|
||||
|
||||
################################################################################
|
||||
# merge
|
||||
################################################################################
|
||||
|
|
@ -86,9 +113,23 @@ LABEL maintainer="fcwu.tw@gmail.com"
|
|||
COPY --from=builder /src/web/dist/ /usr/local/lib/web/frontend/
|
||||
COPY image /
|
||||
|
||||
# now install ~/bin directory with repo from NXP i.MX recommended yocto packages
|
||||
#RUN mkdir ~/bin && curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
|
||||
|
||||
# now clone Poky in (from Yocto quick setup guide)
|
||||
#RUN apt-get update && mkdir -p /root/poky && echo $PWD && git clone git://git.yoctoproject.org/poky /root/poky && echo $PWD && cd /root/poky && echo $PWD && git checkout tags/yocto-2.5 -b my-yocto-2.5
|
||||
#RUN cd /root
|
||||
#RUN pwd
|
||||
#RUN git clone git://git.yoctoproject.org/poky
|
||||
#RUN pwd
|
||||
#RUN cd ./poky
|
||||
#RUN pwd
|
||||
#RUN ls
|
||||
#RUN git checkout tags/yocto-2.5 -b my-yocto-2.5
|
||||
|
||||
EXPOSE 80
|
||||
WORKDIR /root
|
||||
ENV HOME=/home/ubuntu \
|
||||
WORKDIR /home
|
||||
ENV HOME=/home/ \
|
||||
SHELL=/bin/bash
|
||||
HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://127.0.0.1/api/health
|
||||
ENTRYPOINT ["/startup.sh"]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/bash
|
||||
echo "Beginning of startup.sh script"
|
||||
|
||||
if [ -n "$VNC_PASSWORD" ]; then
|
||||
echo "starting set password section"
|
||||
echo -n "$VNC_PASSWORD" > /.password1
|
||||
x11vnc -storepasswd $(cat /.password1) /.password2
|
||||
chmod 400 /.password*
|
||||
|
|
@ -9,12 +11,16 @@ if [ -n "$VNC_PASSWORD" ]; then
|
|||
fi
|
||||
|
||||
if [ -n "$RESOLUTION" ]; then
|
||||
echo "starting set resolution section"
|
||||
sed -i "s/1024x768/$RESOLUTION/" /usr/local/bin/xvfb.sh
|
||||
fi
|
||||
|
||||
echo "setting USER to root"
|
||||
USER=${USER:-root}
|
||||
echo "setting HOME to root"
|
||||
HOME=/root
|
||||
if [ "$USER" != "root" ]; then
|
||||
echo "starting user not equal to root"
|
||||
echo "* enable custom user: $USER"
|
||||
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo $USER
|
||||
if [ -z "$PASSWORD" ]; then
|
||||
|
|
@ -26,37 +32,93 @@ if [ "$USER" != "root" ]; then
|
|||
cp -r /root/{.gtkrc-2.0,.asoundrc} ${HOME}
|
||||
[ -d "/dev/snd" ] && chgrp -R adm /dev/snd
|
||||
fi
|
||||
|
||||
echo "starting sed -i etc, supervisor, conf.d, supervisord.conf"
|
||||
sed -i "s|%USER%|$USER|" /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
echo "starting 2nd line of sed -i etc, supervisor, conf.d, supervisord.conf"
|
||||
sed -i "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# home folder
|
||||
echo "about to mkdir for .config, pacmanfm, lxde"
|
||||
mkdir -p $HOME/.config/pcmanfm/LXDE/
|
||||
echo "about to ln -sf /usr/local/share/doro-lxde-wallpapers/desktop-teims.blah"
|
||||
|
||||
ln -sf /usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf $HOME/.config/pcmanfm/LXDE/
|
||||
chown -R $USER:$USER $HOME
|
||||
echo "about to chown USER"
|
||||
|
||||
chown -R --verbose $USER:$USER $HOME
|
||||
|
||||
# nginx workers
|
||||
echo "about to sed -i nginx workers"
|
||||
sed -i 's|worker_processes .*|worker_processes 1;|' /etc/nginx/nginx.conf
|
||||
|
||||
# nginx ssl
|
||||
if [ -n "$SSL_PORT" ] && [ -e "/etc/nginx/ssl/nginx.key" ]; then
|
||||
echo "* enable SSL"
|
||||
echo "starting to enable SSL"
|
||||
sed -i 's|#_SSL_PORT_#\(.*\)443\(.*\)|\1'$SSL_PORT'\2|' /etc/nginx/sites-enabled/default
|
||||
sed -i 's|#_SSL_PORT_#||' /etc/nginx/sites-enabled/default
|
||||
fi
|
||||
|
||||
# nginx http base authentication
|
||||
if [ -n "$HTTP_PASSWORD" ]; then
|
||||
echo "about to enable http base authentication"
|
||||
echo "* enable HTTP base authentication"
|
||||
htpasswd -bc /etc/nginx/.htpasswd $USER $HTTP_PASSWORD
|
||||
sed -i 's|#_HTTP_PASSWORD_#||' /etc/nginx/sites-enabled/default
|
||||
fi
|
||||
|
||||
# novnc websockify
|
||||
echo "about to novnc websockify"
|
||||
echo "about to ln -s /usr/local/lib/web/frontend/static/websockify"
|
||||
|
||||
ln -s /usr/local/lib/web/frontend/static/websockify /usr/local/lib/web/frontend/static/novnc/utils/websockify
|
||||
echo "about to chmod +x /usr/local/lib/web/frontend/static/websockify/run"
|
||||
chmod +x /usr/local/lib/web/frontend/static/websockify/run
|
||||
|
||||
# clearup
|
||||
echo "clearup. about to set password and http_password to null"
|
||||
|
||||
PASSWORD=
|
||||
HTTP_PASSWORD=
|
||||
|
||||
|
||||
BINDIRECTORY="~/bin"
|
||||
REPODIRECTORY="~/bin/repo"
|
||||
if [ ! -d "$BINDIRECTORY" ]; then
|
||||
|
||||
# Control will enter here if ~/bin doesn't exist.
|
||||
# now mkdir ~/bin and install ~/bin/repo directory with repo from NXP i.MX recommended yocto packages
|
||||
mkdir ~/bin
|
||||
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
|
||||
chmod a+x ~/bin/repo
|
||||
elif [ ! -d "REPODIRECTORY" ]; then
|
||||
# Control will enter here if ~/bin DOES exist but ~/bin/repo doesn't exist.
|
||||
# now install ~/bin directory with repo from NXP i.MX recommended yocto packages
|
||||
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
|
||||
chmod a+x ~/bin/repo
|
||||
else
|
||||
echo "something went wrong with curl of i.MX recommended packages"
|
||||
fi
|
||||
|
||||
# now clone Poky in (from Yocto quick setup guide)
|
||||
apt-get update
|
||||
|
||||
POKYDIR="/root/poky"
|
||||
if [ ! -d "$POKYDIR" ]; then
|
||||
|
||||
mkdir -p $POKYDIR
|
||||
echo $PWD
|
||||
git clone git://git.yoctoproject.org/poky $POKYDIR
|
||||
echo $PWD
|
||||
cd $POKYDIR
|
||||
echo $PWD
|
||||
git checkout tags/yocto-2.5 -b my-yocto-2.5
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo "about to exec /bin/tini -- usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf"
|
||||
|
||||
exec /bin/tini -- /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
|
||||
|
|
|
|||
Loading…
Reference in New Issue