├── Dockerfile
├── README.md
└── files
├── etc
└── fonts
│ └── conf.d
│ └── 10-antialias.conf
├── root
├── .bashrc
├── .config
│ ├── lxpanel
│ │ └── LXDE
│ │ │ └── panels
│ │ │ └── panel
│ └── pcmanfm
│ │ └── LXDE
│ │ ├── desktop-items-0.conf
│ │ └── pcmanfm.conf
├── .gtkrc-2.0
└── .gtkrc-2.0.mine
├── startup.sh
└── usr
└── local
└── share
└── doro-lxde-wallpapers
└── desktop-items-0.conf
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM dorowu/ubuntu-desktop-lxde-vnc:focal
2 |
3 | # ENV http_proxy http://192.168.1.1:1082
4 | # ENV https_proxy http://192.168.1.1:1082
5 |
6 | RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
7 | RUN apt-get update -qq \
8 | && apt-get purge -y -qq google-chrome-stable \
9 | && apt-get upgrade -y -qq
10 |
11 | # Set Area and Timezone
12 | RUN echo 'tzdata tzdata/Areas select Asia' | debconf-set-selections
13 | RUN echo 'tzdata tzdata/Zones/Asia select Chongqing' | debconf-set-selections
14 | RUN DEBIAN_FRONTEND="noninteractive" apt install -y tzdata
15 |
16 | # Install required packages for FriendlyElec's boards
17 | RUN apt-get -y install texinfo git
18 | RUN git clone https://github.com/friendlyarm/build-env-on-ubuntu-bionic
19 | RUN chmod 755 build-env-on-ubuntu-bionic/install.sh
20 | RUN build-env-on-ubuntu-bionic/install.sh
21 | RUN rm -rf build-env-on-ubuntu-bionic
22 | RUN update-alternatives --install $(which python) python /usr/bin/python2.7 20
23 | RUN git clone https://github.com/friendlyarm/repo
24 | RUN cp repo/repo /usr/bin/
25 |
26 | # Install other required packages
27 | RUN apt-get install -y --no-install-recommends -qq \
28 | software-properties-common locales \
29 | nano bash-completion lxtask openssh-server xdotool filezilla putty dnsutils \
30 | papirus-icon-theme fonts-noto-cjk fonts-noto-cjk-extra obconf lxappearance-obconf vim terminator tree rsync \
31 | poppler-utils shared-mime-info mime-support
32 | RUN apt-get clean
33 |
34 | # Customizations : remove unused, change settings, copy conf files
35 | COPY files /
36 |
37 | # SSHD run bugfix
38 | RUN mkdir -p /run/sshd
39 |
40 | # Fixing the issue: Communication error with Jack server (35) when building AOSP (Android8.1)
41 | RUN sed 's/^\(jdk.tls.disabledAlgorithms=.*\)\(TLSv1, TLSv1.1, \)/\1/g' /etc/java-8-openjdk/security/java.security -i
42 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # docker-cross-compiler-novnc
2 |
3 | Docker-based build environment based on [dorowu/ubuntu-desktop-lxde-vnc](https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc) with pre-built and configured toolchains for cross compiling.
4 |
5 | ---
6 | ## Usage
7 | ### Installation
8 | ```
9 | git clone https://github.com/friendlyarm/docker-ubuntu-lxde-novnc
10 | cd docker-ubuntu-lxde-novnc
11 | docker build --no-cache -t docker-ubuntu-lxde-novnc .
12 | ```
13 | or setup the proxy for Dockerfile building:
14 | ```
15 | vim Dockerfile
16 | ```
17 | Uncomment the following two lines, change the proxy address and rebuild:
18 | ```
19 | # ENV http_proxy http://192.168.1.1:1082
20 | # ENV https_proxy http://192.168.1.1:1082
21 | ```
22 | Note: do not use 127.0.0.1 for the proxy address, use the IP address of the LAN instead
23 |
24 | ### Run
25 | *Note: Mapping the /dev directory is to make the newly created loop devices appear in the container.*
26 | ```
27 | mkdir ~/work
28 | chown 1000:1000 ~/work
29 | docker run --rm --privileged -v /dev:/dev \
30 | --name docker-ubuntu-lxde-novnc \
31 | -p 6080:80 \
32 | -p 5900:5900 \
33 | -e HTTP_PASSWORD=password \
34 | -e VNC_PASSWORD=password \
35 | -e PUID=1000 \
36 | -e PGID=1000 \
37 | -e USER=ubuntu \
38 | -e PASSWORD=ubuntu \
39 | -v ~/.gitconfig:/home/ubuntu/.gitconfig:ro \
40 | -v ~/work:/home/ubuntu/work \
41 | -e RESOLUTION=1280x720 \
42 | docker-ubuntu-lxde-novnc:latest
43 | ```
44 | ### Check your git configuration
45 | ```
46 | docker exec -it --user ubuntu docker-ubuntu-lxde-novnc bash -c 'git config --list'
47 | ```
48 | ### Get a bash shell
49 | ```
50 | docker exec -it --user ubuntu --workdir /home/ubuntu docker-ubuntu-lxde-novnc bash
51 | ```
52 | ### VNC Viewer
53 | open the vnc viewer and connect to port 5900.
54 | ### Web brower
55 | Browse http://127.0.0.1:6080/
56 | ## Test Cases
57 | Successfully compiled the following projects:
58 | - [x] android 8.1
59 | - [x] android 10
60 | - [x] android 12 (tv & tablet)
61 | - [x] kernel 4.4
62 | - [x] kernel 4.19
63 | - [x] kernel 5.10
64 | - [x] kernel 5.15
65 | - [x] uboot v2014.10
66 | - [x] uboot v2017.09
67 | - [x] friendlywrt v22.03
68 | - [x] friendlywrt v21.02
69 | - [x] buildroot
70 | - [x] package the image by using sd-fuse_xxx
71 | ---
72 | ## Environment Variables
73 |
74 | ### `FASTBOOT`
75 | * `true`
76 | Faster container initialization by skipping `chown`-ing every files and directories under `$HOME` on container startup. This may be useful when volume is linked on `$HOME` or its subdirectory, and contains lots of files and directories. __Enabling this option might cause files under `$HOME` inaccessible by container.__
77 | * `false`
78 | `chown` every file under `$HOME` on container startup.
79 | * **DEFAULT** `false`
80 |
81 | ### `RESOLUTION`
82 | * Set screen resolution in `NNNNxNNNN` form, like `1366x768`.
83 | * **DEFAULT** _Follows the size of the browser window when first connected._
84 |
85 | ### `USERNAME`
86 | * Name of default user.
87 | * **DEFAULT** `root`
88 |
89 | ### `PASSWORD`
90 | * Password of the user inside the container. This may required if you want to use SSH with password authentication, or normal user rather than `root`.
91 |
92 | ### `HTTP_PASSWORD`
93 | * Password for authentication before loading noVNC screen. `USERNAME` is used as username. Password may be sent without any protection - use other authentication method when possible if this container is planned to be run as worldwide-public.
94 |
95 | ### `VNC_PASSWORD`
96 | * Authentication method provided by noVNC. Password longer than 8 characters will be truncated to 8 characters.
97 |
98 | ---
99 | ## Acknowledgments
100 | - [fcwu/docker-ubuntu-vnc-desktop](https://github.com/fcwu/docker-ubuntu-vnc-desktop)
101 | - [hdavid0510/docker-ubuntu-lxde-novnc](https://github.com/hdavid0510/docker-ubuntu-lxde-novnc)
102 | - [dorowu/ubuntu-desktop-lxde-vnc](https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc)
103 |
--------------------------------------------------------------------------------
/files/etc/fonts/conf.d/10-antialias.conf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | false
7 |
8 |
9 |
--------------------------------------------------------------------------------
/files/root/.bashrc:
--------------------------------------------------------------------------------
1 | # ~/.bashrc: executed by bash(1) for non-login shells.
2 | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
3 | # for examples
4 |
5 | # If not running interactively, don't do anything
6 | [ -z "$PS1" ] && return
7 |
8 | # don't put duplicate lines in the history. See bash(1) for more options
9 | # ... or force ignoredups and ignorespace
10 | HISTCONTROL=ignoredups:ignorespace
11 |
12 | # append to the history file, don't overwrite it
13 | shopt -s histappend
14 |
15 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
16 | HISTSIZE=1000
17 | HISTFILESIZE=2000
18 |
19 | # check the window size after each command and, if necessary,
20 | # update the values of LINES and COLUMNS.
21 | shopt -s checkwinsize
22 |
23 | # make less more friendly for non-text input files, see lesspipe(1)
24 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
25 |
26 | # set variable identifying the chroot you work in (used in the prompt below)
27 | if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
28 | debian_chroot=$(cat /etc/debian_chroot)
29 | fi
30 |
31 | # set a fancy prompt (non-color, unless we know we "want" color)
32 | case "$TERM" in
33 | xterm-color) color_prompt=yes;;
34 | esac
35 |
36 | # uncomment for a colored prompt, if the terminal has the capability; turned
37 | # off by default to not distract the user: the focus in a terminal window
38 | # should be on the output of commands, not on the prompt
39 | #force_color_prompt=yes
40 |
41 | if [ -n "$force_color_prompt" ]; then
42 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
43 | # We have color support; assume it's compliant with Ecma-48
44 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
45 | # a case would tend to support setf rather than setaf.)
46 | color_prompt=yes
47 | else
48 | color_prompt=
49 | fi
50 | fi
51 |
52 | if [ "$color_prompt" = yes ]; then
53 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
54 | else
55 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
56 | fi
57 | unset color_prompt force_color_prompt
58 |
59 | # If this is an xterm set the title to user@host:dir
60 | case "$TERM" in
61 | xterm*|rxvt*)
62 | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
63 | ;;
64 | *)
65 | ;;
66 | esac
67 |
68 | # enable color support of ls and also add handy aliases
69 | if [ -x /usr/bin/dircolors ]; then
70 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
71 | alias ls='ls --color=auto'
72 | #alias dir='dir --color=auto'
73 | #alias vdir='vdir --color=auto'
74 |
75 | alias grep='grep --color=auto'
76 | alias fgrep='fgrep --color=auto'
77 | alias egrep='egrep --color=auto'
78 | fi
79 |
80 | # some more ls aliases
81 | alias ll='ls -alF'
82 | alias la='ls -A'
83 | alias l='ls -CF'
84 |
85 | # Alias definitions.
86 | # You may want to put all your additions into a separate file like
87 | # ~/.bash_aliases, instead of adding them here directly.
88 | # See /usr/share/doc/bash-doc/examples in the bash-doc package.
89 |
90 | if [ -f ~/.bash_aliases ]; then
91 | . ~/.bash_aliases
92 | fi
93 |
94 | # enable programmable completion features (you don't need to enable
95 | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
96 | # sources /etc/bash.bashrc).
97 | #if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
98 | # . /etc/bash_completion
99 | #fi
100 |
--------------------------------------------------------------------------------
/files/root/.config/lxpanel/LXDE/panels/panel:
--------------------------------------------------------------------------------
1 | # lxpanel config file. Manually editing is not recommended.
2 | # Use preference dialog in lxpanel to adjust config when you can.
3 |
4 | Global {
5 | edge=bottom
6 | align=left
7 | margin=0
8 | widthtype=percent
9 | width=100
10 | height=26
11 | transparent=0
12 | tintcolor=#000000
13 | alpha=0
14 | setdocktype=1
15 | setpartialstrut=1
16 | autohide=0
17 | heightwhenhidden=0
18 | usefontcolor=1
19 | fontcolor=#ffffff
20 | background=0
21 | backgroundfile=/usr/share/lxpanel/images/background.png
22 | }
23 | Plugin {
24 | type=menu
25 | Config {
26 | image=/usr/share/lxde/images/lxde-icon.png
27 | system {
28 | }
29 | separator {
30 | }
31 | item {
32 | command=run
33 | }
34 | separator {
35 | }
36 | item {
37 | image=gnome-logout
38 | command=logout
39 | }
40 | }
41 | }
42 | Plugin {
43 | type=launchbar
44 | Config {
45 | Button {
46 | id=pcmanfm.desktop
47 | }
48 | Button {
49 | id=lxde-x-www-browser.desktop
50 | }
51 | Button {
52 | id=code.desktop
53 | }
54 | Button {
55 | id=terminator.desktop
56 | }
57 | }
58 | }
59 | Plugin {
60 | type=taskbar
61 | expand=1
62 | Config {
63 | tooltips=1
64 | IconsOnly=0
65 | AcceptSkipPager=1
66 | ShowIconified=1
67 | ShowMapped=1
68 | ShowAllDesks=0
69 | UseMouseWheel=1
70 | UseUrgencyHint=1
71 | FlatButton=0
72 | MaxTaskWidth=150
73 | spacing=1
74 | }
75 | }
76 | Plugin {
77 | type=tray
78 | Config {
79 | }
80 | }
81 | Plugin {
82 | type=monitors
83 | Config {
84 | DisplayCPU=1
85 | DisplayRAM=1
86 | CPUColor=#00FF00
87 | RAMColor=#00FFFF
88 | }
89 | }
90 | Plugin {
91 | type=dclock
92 | Config {
93 | ClockFmt=%H:%M
94 | TooltipFmt=%Y.%m.%d. %a
95 | BoldFont=0
96 | IconOnly=0
97 | CenterText=0
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/files/root/.config/pcmanfm/LXDE/desktop-items-0.conf:
--------------------------------------------------------------------------------
1 | [*]
2 | wallpaper_mode=color
3 | wallpaper_common=0
4 | wallpapers_configured=1
5 | wallpaper0=/usr/local/share/doro-lxde-wallpapers/bg1.jpg
6 | desktop_bg=#141414
7 | desktop_fg=#ffffff
8 | desktop_shadow=#000000
9 | desktop_font=Sans 10
10 | show_wm_menu=0
11 | sort=mtime;ascending;mingle;
12 | show_documents=0
13 | show_trash=1
14 | show_mounts=0
--------------------------------------------------------------------------------
/files/root/.config/pcmanfm/LXDE/pcmanfm.conf:
--------------------------------------------------------------------------------
1 | [config]
2 | bm_open_method=0
3 |
4 | [volume]
5 | mount_on_startup=1
6 | mount_removable=1
7 | autorun=1
8 |
9 | [ui]
10 | always_show_tabs=1
11 | max_tab_chars=32
12 | win_width=640
13 | win_height=480
14 | splitter_pos=150
15 | media_in_new_tab=0
16 | desktop_folder_new_win=0
17 | change_tab_on_drop=1
18 | close_on_unmount=1
19 | focus_previous=0
20 | side_pane_mode=places
21 | view_mode=list
22 | show_hidden=1
23 | sort=name;ascending;
24 | toolbar=newtab;navigation;home;
25 | show_statusbar=1
26 | pathbar_mode_buttons=0
27 |
--------------------------------------------------------------------------------
/files/root/.gtkrc-2.0:
--------------------------------------------------------------------------------
1 | # DO NOT EDIT! This file will be overwritten by LXAppearance.
2 | # Any customization should be done in ~/.gtkrc-2.0.mine instead.
3 |
4 | include "$HOME/.gtkrc-2.0.mine"
5 | gtk-theme-name="Adwaita-dark"
6 | gtk-icon-theme-name="Papirus-Dark"
7 | gtk-font-name="Sans 10"
8 | gtk-cursor-theme-name="Adwaita"
9 | gtk-cursor-theme-size=18
10 | gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
11 | gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
12 | gtk-button-images=1
13 | gtk-menu-images=1
14 | gtk-enable-event-sounds=1
15 | gtk-enable-input-feedback-sounds=1
16 | gtk-xft-antialias=0
17 | gtk-xft-hinting=0
18 | gtk-xft-hintstyle="hintfull"
19 | gtk-xft-rgba="rgb"
20 |
--------------------------------------------------------------------------------
/files/root/.gtkrc-2.0.mine:
--------------------------------------------------------------------------------
1 | gtk-theme-name="Adwaita-dark"
2 | gtk-icon-theme-name="Papirus-Dark"
3 | gtk-font-name="Sans 10"
4 | gtk-cursor-theme-name="Adwaita"
5 | gtk-cursor-theme-size=18
6 | gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
7 | gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
8 | gtk-button-images=1
9 | gtk-menu-images=1
10 | gtk-enable-event-sounds=1
11 | gtk-enable-input-feedback-sounds=1
12 | gtk-xft-antialias=0
13 | gtk-xft-hinting=0
14 | gtk-xft-hintstyle="hintfull"
15 | gtk-xft-rgba="rgb"
--------------------------------------------------------------------------------
/files/startup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ -n "$VNC_PASSWORD" ]; then
4 | echo -n "$VNC_PASSWORD" > /.password1
5 | x11vnc -storepasswd $(cat /.password1) /.password2
6 | chmod 400 /.password*
7 | sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf
8 | export VNC_PASSWORD=
9 | fi
10 |
11 | if [ -n "$X11VNC_ARGS" ]; then
12 | sed -i "s/^command=x11vnc.*/& ${X11VNC_ARGS}/" /etc/supervisor/conf.d/supervisord.conf
13 | fi
14 |
15 | if [ -n "$OPENBOX_ARGS" ]; then
16 | sed -i "s#^command=/usr/bin/openbox\$#& ${OPENBOX_ARGS}#" /etc/supervisor/conf.d/supervisord.conf
17 | fi
18 |
19 | if [ -n "$RESOLUTION" ]; then
20 | sed -i "s/1024x768/$RESOLUTION/" /usr/local/bin/xvfb.sh
21 | fi
22 |
23 | PGID=${PGID:-1000}
24 | PUID=${PUID:-1000}
25 | USER=${USER:-root}
26 | HOME=/root
27 | if [ "$USER" != "root" ]; then
28 | echo "* enable custom user: $USER"
29 | groupadd -r -g $PGID $USER
30 | useradd -u $PUID -g $PGID --create-home --shell /bin/bash --groups adm,sudo $USER
31 | if [ -z "$PASSWORD" ]; then
32 | echo " set default password to \"ubuntu\""
33 | PASSWORD=ubuntu
34 | fi
35 | HOME=/home/$USER
36 | echo "$USER:$PASSWORD" | chpasswd
37 | cp -r /root/{.config,.gtkrc-2.0,.asoundrc} ${HOME}
38 | cp -f /root/.gtkrc-2.0.mine ${HOME}
39 | chown -R $USER:$USER ${HOME}
40 | [ -d "/dev/snd" ] && chgrp -R adm /dev/snd
41 | fi
42 | sed -i -e "s|%USER%|$USER|" -e "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf
43 |
44 | # home folder
45 | if [ ! -x "$HOME/.config/pcmanfm/LXDE/" ]; then
46 | mkdir -p $HOME/.config/pcmanfm/LXDE/
47 | ln -sf /usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf $HOME/.config/pcmanfm/LXDE/
48 | chown -R $USER:$USER $HOME
49 | fi
50 |
51 | # nginx workers
52 | sed -i 's|worker_processes .*|worker_processes 1;|' /etc/nginx/nginx.conf
53 |
54 | # nginx ssl
55 | if [ -n "$SSL_PORT" ] && [ -e "/etc/nginx/ssl/nginx.key" ]; then
56 | echo "* enable SSL"
57 | sed -i 's|#_SSL_PORT_#\(.*\)443\(.*\)|\1'$SSL_PORT'\2|' /etc/nginx/sites-enabled/default
58 | sed -i 's|#_SSL_PORT_#||' /etc/nginx/sites-enabled/default
59 | fi
60 |
61 | # nginx http base authentication
62 | if [ -n "$HTTP_PASSWORD" ]; then
63 | echo "* enable HTTP base authentication"
64 | htpasswd -bc /etc/nginx/.htpasswd $USER $HTTP_PASSWORD
65 | sed -i 's|#_HTTP_PASSWORD_#||' /etc/nginx/sites-enabled/default
66 | fi
67 |
68 | # dynamic prefix path renaming
69 | if [ -n "$RELATIVE_URL_ROOT" ]; then
70 | echo "* enable RELATIVE_URL_ROOT: $RELATIVE_URL_ROOT"
71 | sed -i 's|#_RELATIVE_URL_ROOT_||' /etc/nginx/sites-enabled/default
72 | sed -i 's|_RELATIVE_URL_ROOT_|'$RELATIVE_URL_ROOT'|' /etc/nginx/sites-enabled/default
73 | fi
74 |
75 | # clearup
76 | PASSWORD=
77 | HTTP_PASSWORD=
78 |
79 | exec /bin/tini -- supervisord -n -c /etc/supervisor/supervisord.conf
80 |
--------------------------------------------------------------------------------
/files/usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf:
--------------------------------------------------------------------------------
1 | [*]
2 | wallpaper_mode=color
3 | wallpaper_common=0
4 | wallpapers_configured=1
5 | wallpaper0=/usr/local/share/doro-lxde-wallpapers/bg1.jpg
6 | desktop_bg=#141414
7 | desktop_fg=#ffffff
8 | desktop_shadow=#000000
9 | desktop_font=Sans 10
10 | show_wm_menu=0
11 | sort=mtime;ascending;mingle;
12 | show_documents=0
13 | show_trash=1
14 | show_mounts=0
15 |
--------------------------------------------------------------------------------