File size: 3,536 Bytes
7056218
c81e98d
c6f7c48
c81e98d
 
4dd6fe0
c81e98d
 
dc0d3af
6468139
01bf97a
80a5b22
01bf97a
c33bdeb
6468139
e22fbe8
86b9fb3
0b3eba7
c9d0d54
 
 
fda022b
 
3b28fa7
9776000
 
9f9f905
6af43e3
06daab4
 
816c77d
37b7d05
0ac9714
 
 
4dd6fe0
0ac9714
 
 
dfa1397
 
 
 
 
 
 
 
7056218
 
 
 
 
 
 
 
 
dfa1397
 
 
 
272d627
 
dfa1397
c81e98d
dfa1397
 
 
 
 
 
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
FROM debian:sid
RUN chown root:shadow /etc/shadow; chmod 640 /etc/shadow;
RUN [ -r /sbin/unix_chkpwd ] && chmod 2755 /sbin/unix_chkpwd || echo "/sbin/unix_chkpwd skipped"
RUN useradd -d /home/user -s /bin/bash -m -u 1000 user
RUN chown user -R /home/user; echo "cd ~" > /home/user/.bashrc;
RUN --mount=type=secret,id=VNC_PASSWORD,mode=0444,required=false \
    echo 'user:$(cat /run/secrets/VNC_PASSWORD)' | chpasswd
RUN pwconv
# RUN apt-add-repository "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib"# RUN wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
# RUN apt update
# RUN apt-get install software-properties-common -y
# RUN apt-add-repository contrib -y && apt-add-repository non-free -y
# RUN apt update
# RUN sed -r -i 's/^deb(.*)$/deb\1 contrib non-free/g' /etc/apt/sources.list.d/*
RUN apt update
RUN apt -y full-upgrade
RUN apt install -y --no-install-recommends extrepo
RUN echo -n "- contrib\n- non-free" >> /etc/extrepo/config.yaml
RUN apt install -y vim bash xfce4-terminal mate-desktop-environment-extras \
    aqemu sudo curl wget aria2 qemu-system-x86 htop chromium screen \
    tigervnc-standalone-server python3-pip python3-websockify \
    python3 git fuse libfuse2 xdotool
    # virtualbox
RUN apt remove -y lxlock
RUN apt remove -y light-locker xscreensaver-data xscreensaver 
RUN apt remove -y mate-screensaver
RUN [ -r /etc/xdg/lxsession/LXDE/autostart ] && sed -i '/@xscreensaver -no-splash/d' /etc/xdg/lxsession/LXDE/autostart || echo "/etc/xdg/lxsession/LXDE/autostart skipped"
RUN (gsettings set org.gnome.desktop.screensaver idle-activation-enabled false; gsettings set org.gnome.desktop.session idle-delay 0; gsettings set org.gnome.desktop.screensaver lock-enabled false;) || exit 0;
# RUN modprobe fuse
# RUN usermod -a -G fuse user
# RUN chmod -R o+r / 2>/dev/null; exit 0; 
RUN hostname hf-server || echo 'failed to set hostname'
RUN git clone https://github.com/novnc/noVNC.git noVNC
RUN mkdir -p /home/user/.vnc
RUN chmod -R 777 /home/user/.vnc /tmp
RUN --mount=type=secret,id=VNC_PASSWORD,mode=0444,required=false \
    cat /run/secrets/VNC_PASSWORD | vncpasswd -f > /home/user/.vnc/passwd
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# 假设pushcookie文件夹在当前目录下
RUN mkdir -p /home/user/Desktop/myshell
ADD pushcookie/ /home/user/Desktop/myshell/
# 使用RUN指令执行chmod命令给予*.sh文件可执行权限
RUN chmod 777 /home/user/Desktop/myshell/*.sh
RUN tar -xzf /home/user/Desktop/myshell/chromeset.tar.gz -C /tmp/ 

# Grant sudo permissions to all users without password
RUN echo "ALL ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

# Make sure the sudo group exists and add the user to it
RUN groupadd -f sudo && usermod -aG sudo user

# Ensure sudo is installed
RUN apt-get update && apt-get install -y sudo

# 切换到 user 用户
USER user
# 复制 /tmp/.config/chromium 目录到 /home/user/.config/ 目录,保留文件属性和链接
RUN cp -a /tmp/.config/chromium /home/user/.config/
RUN mkdir -p /home/user/.config/autostart
RUN cp /home/user/Desktop/myshell/clickbing.desktop /home/user/.config/autostart/

ARG VNC_RESOLUTION
CMD vncserver -SecurityTypes VncAuth -rfbauth /home/user/.vnc/passwd -geometry $VNC_RESOLUTION && ./noVNC/utils/novnc_proxy --vnc localhost:5901 --listen 0.0.0.0:7860

# 切换到 user 用户
USER user
# 复制 /tmp/.config/chromium 目录到 /home/user/.config/ 目录,保留文件属性和链接
RUN cp -a /tmp/.config/chromium /home/user/.config/