mirror of
https://github.com/fcwu/docker-ubuntu-vnc-desktop
synced 2025-12-09 18:02:22 +01:00
Reconfigured users home directory
This commit is contained in:
parent
8eb6c0dfb0
commit
845e1aa1fc
5 changed files with 33 additions and 19 deletions
|
|
@ -95,8 +95,8 @@ RUN mkdir /workspace
|
|||
|
||||
# Clone and install cloud9
|
||||
RUN git clone https://github.com/c9/core.git /cloud9/c9sdk
|
||||
RUN mkdir -p /cloud9/c9sdk/build /workspace/.ubuntu/.standalone
|
||||
RUN ln -sf /workspace/.ubuntu/.standalone /cloud9/c9sdk/build/standalone
|
||||
#RUN mkdir -p /cloud9/c9sdk/build /workspace/.ubuntu/.standalone
|
||||
#RUN ln -sf /workspace/.ubuntu/.standalone /cloud9/c9sdk/build/standalone
|
||||
RUN /cloud9/c9sdk/scripts/install-sdk.sh
|
||||
RUN cd /cloud9/c9sdk && git reset --hard
|
||||
RUN wget -O user-install.sh https://raw.githubusercontent.com/c9/install/master/install.sh && mv user-install.sh /cloud9/
|
||||
|
|
@ -161,7 +161,8 @@ RUN echo \
|
|||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin menulibre python3-pip keychain python3.8-venv strace gedit gvfs-backends
|
||||
RUN apt-get -y install menulibre python3-pip keychain python3.8-venv strace gedit gvfs-backends
|
||||
RUN apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||
|
||||
RUN wget -O beyond-compare.deb https://www.scootersoftware.com/$(curl -sd "platform=linux" https://www.scootersoftware.com/download.php | grep amd64.deb | awk -F\" '{print $2}' | sed 's/\///g')
|
||||
RUN wget -O sublime-text.deb $(curl -s https://www.sublimetext.com/download_thanks?target=x64-deb#direct-downloads | grep amd64.deb | grep url | awk -F'"' '{print $2}')
|
||||
|
|
@ -172,4 +173,5 @@ RUN apt install -y ./beyond-compare.deb ./sublime-text.deb ./sublime-merge.deb .
|
|||
RUN npm -g install sass yuglify
|
||||
|
||||
# Copy files
|
||||
COPY rootfs /
|
||||
COPY rootfs /
|
||||
RUN rm -rf /workspace/*
|
||||
|
|
@ -11,7 +11,6 @@ sleep 5
|
|||
|
||||
DBUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
|
||||
echo "DBUS Session Address: $DBUS_ADDRESS"
|
||||
echo "$DBUS_ADDRESS" > /var/log/dbus.txt
|
||||
export DBUS_SESSION_BUS_ADDRESS
|
||||
export DISPLAY=:1.0
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,6 @@ command=bash -c 'while ps aux | grep user-install.sh | grep -v grep 2>&1> /dev/n
|
|||
|
||||
[program:desktop]
|
||||
priority=30
|
||||
directory=/workspace/.ubuntu/dynamic-background/active
|
||||
directory=/home/%USER%/.dynamic-background/active
|
||||
user=%USER%
|
||||
command=bash /usr/share/backgrounds/dynamic.sh
|
||||
|
|
@ -31,7 +31,8 @@ USER=${USER:-root}
|
|||
HOME=/root
|
||||
if [ "$USER" != "root" ]; then
|
||||
echo "* enable custom user: $USER"
|
||||
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo,docker -d /workspace/.home/$USER $USER
|
||||
#useradd --create-home --shell /bin/bash --user-group --groups adm,sudo,docker -d /workspace/.home/$USER $USER
|
||||
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo,docker $USER
|
||||
|
||||
if [ -z "$PASSWORD" ]; then
|
||||
echo " set default password to \"ubuntu\""
|
||||
|
|
@ -41,7 +42,8 @@ if [ "$USER" != "root" ]; then
|
|||
|
||||
PASSWORD=$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)
|
||||
fi
|
||||
HOME=/workspace/.home/$USER
|
||||
#HOME=/workspace/.home/$USER
|
||||
HOME=/home/$USER
|
||||
echo "$USER:$PASSWORD" | chpasswd
|
||||
cp -r /root/{.config,.gtkrc-2.0,.asoundrc} ${HOME}
|
||||
chown -R $USER:$USER ${HOME}
|
||||
|
|
@ -86,27 +88,39 @@ if [ -n "$DOMAIN" ]; then
|
|||
fi
|
||||
|
||||
# Reduce this so its not everything
|
||||
chown -R $USER:$USER $HOME /cloud9 /workspace/.c9 /workspace/.$USER
|
||||
#chown -R $USER:$USER $HOME /cloud9 /workspace
|
||||
|
||||
# Add required packages for ubuntu user (Run as user)
|
||||
|
||||
rm -rf $HOME/.c9
|
||||
mkdir -p /workspace/.c9
|
||||
chown $USER:$USER /workspace/.c9
|
||||
sudo -H -u $USER bash -c 'bash /cloud9/user-install.sh' 2>&1> /workspace/.c9/install.log &
|
||||
#rm -rf $HOME/.c9
|
||||
#mkdir -p /workspace/.c9
|
||||
#chown $USER:$USER /workspace/.c9
|
||||
sudo -H -u $USER bash -c 'bash /cloud9/user-install.sh' 2>&1> /home/$USER/.cloud9-install.log &
|
||||
|
||||
# Only for testing while editing the menu
|
||||
chown $USER /usr/share/applications/
|
||||
#chown $USER /usr/share/applications/
|
||||
|
||||
# Setup Backgrounds
|
||||
mkdir -p /workspace/.ubuntu/dynamic-background/active/
|
||||
mkdir -p /home/$USER/.dynamic-background/active/
|
||||
for BACKGROUND in $(ls -1 /usr/share/backgrounds/dynamic-background/ | grep -v -e "active" -e "default" ); do
|
||||
cp -r /usr/share/backgrounds/dynamic-background/$BACKGROUND /workspace/.ubuntu/dynamic-background/
|
||||
cp -r /usr/share/backgrounds/dynamic-background/$BACKGROUND /home/$USER/.dynamic-background/active/
|
||||
done
|
||||
if [ ! "$(ls -A /workspace/.ubuntu/dynamic-background/active/ )" ]; then
|
||||
cp -r /usr/share/backgrounds/dynamic-background/default/* /workspace/.ubuntu/dynamic-background/active
|
||||
if [ ! "$(ls -A /home/$USER/.dynamic-background/active/ )" ]; then
|
||||
cp -r /usr/share/backgrounds/dynamic-background/default/* /home/$USER/.dynamic-background/active/
|
||||
fi
|
||||
|
||||
bash /cloud9/configure_desktop.sh &
|
||||
|
||||
mkdir /home/$USER/Workspace
|
||||
chown $USER:$USER /home/$USER/Workspace
|
||||
echo "/home/$USER/Workspace /workspace none defaults,bind 0 0" >> /etc/fstab
|
||||
mount -a
|
||||
|
||||
mkdir /home/$USER/.config/gtk-3.0
|
||||
chown $USER:$USER /home/$USER/.config/gtk-3.0
|
||||
echo "file:///home/$USER/Documents" > /home/$USER/.config/gtk-3.0/bookmarks
|
||||
echo "file:///home/$USER/Workspace" >> /home/$USER/.config/gtk-3.0/bookmarks
|
||||
echo "file:///home/$USER/Workspace/Company%20Files" >> /home/$USER/.config/gtk-3.0/bookmarks
|
||||
echo "file:///home/$USER/Downloads" >> /home/$USER/.config/gtk-3.0/bookmarks
|
||||
|
||||
exec /bin/tini -- supervisord -n -c /etc/supervisor/supervisord.conf
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
OLD_FILE=""
|
||||
DBUS_FILE="/var/log/dbus.txt"
|
||||
DIR=$(pwd)
|
||||
|
||||
export DISPLAY=:1.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue