jammss commited on
Commit
3659552
1 Parent(s): 3ed2e1d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -59
Dockerfile CHANGED
@@ -1,59 +1,35 @@
1
- # Build xrdp pulseaudio modules in builder container
2
- # See https://github.com/neutrinolabs/pulseaudio-module-xrdp/wiki/README
3
- ARG TAG=20.4
4
- FROM ubuntu:$TAG as builder
5
-
6
- RUN sed -i -E 's/^# deb-src /deb-src /g' /etc/apt/sources.list \
7
- && apt-get update \
8
- && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
9
- build-essential \
10
- dpkg-dev \
11
- git \
12
- libpulse-dev \
13
- pulseaudio \
14
- && apt-get build-dep -y pulseaudio \
15
- && apt-get source pulseaudio \
16
- && rm -rf /var/lib/apt/lists/*
17
-
18
- RUN cd /pulseaudio-$(pulseaudio --version | awk '{print $2}') \
19
- && ./configure
20
-
21
- RUN git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git /pulseaudio-module-xrdp \
22
- && cd /pulseaudio-module-xrdp \
23
- && ./bootstrap \
24
- && ./configure PULSE_DIR=/pulseaudio-$(pulseaudio --version | awk '{print $2}') \
25
- && make \
26
- && make install
27
-
28
-
29
- # Build the final image
30
- FROM ubuntu:$TAG
31
-
32
- RUN apt-get update \
33
- && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
34
- dbus-x11 \
35
- firefox \
36
- git \
37
- locales \
38
- pavucontrol \
39
- pulseaudio \
40
- pulseaudio-utils \
41
- sudo \
42
- x11-xserver-utils \
43
- xfce4 \
44
- xfce4-goodies \
45
- xfce4-pulseaudio-plugin \
46
- xorgxrdp \
47
- xrdp \
48
- xubuntu-icon-theme \
49
- && rm -rf /var/lib/apt/lists/*
50
-
51
- RUN sed -i -E 's/^; autospawn =.*/autospawn = yes/' /etc/pulse/client.conf \
52
- && [ -f /etc/pulse/client.conf.d/00-disable-autospawn.conf ] && sed -i -E 's/^(autospawn=.*)/# \1/' /etc/pulse/client.conf.d/00-disable-autospawn.conf || : \
53
- && locale-gen en_US.UTF-8
54
- ENV LANG en_US.UTF-8
55
-
56
- COPY --from=builder /usr/lib/pulse-*/modules/module-xrdp-sink.so /usr/lib/pulse-*/modules/module-xrdp-source.so /var/lib/xrdp-pulseaudio-installer/
57
- COPY entrypoint.sh /usr/bin/entrypoint
58
- EXPOSE 3389/tcp
59
- ENTRYPOINT ["/usr/bin/entrypoint"]
 
1
+ # Use the official Debian Bullseye Slim base image
2
+ FROM debian:bullseye-slim
3
+
4
+ # Install sudo and clean up the package manager cache
5
+ RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
6
+
7
+ # Create a non-root user and add it to the sudo group
8
+ RUN useradd -m user && echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user
9
+
10
+ # Switch to the non-root user
11
+ USER user
12
+
13
+ # Set the working directory to the user's home directory
14
+ WORKDIR /home/user
15
+
16
+ # Install Curl
17
+ RUN sudo apt-get update && sudo apt-get install -y curl && sudo rm -rf /var/lib/apt/lists/*
18
+
19
+ # Download the latest version of Ninja from GitHub
20
+ RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/gngpp/ninja/releases/latest)) \
21
+ && base_url="https://github.com/gngpp/ninja/releases/expanded_assets/$version" \
22
+ && latest_url=https://github.com/$(curl -sL $base_url | grep -oP 'href=".*x86_64.*musl\.tar\.gz(?=")' | sed 's/href="//') \
23
+ && curl -Lo ninja.tar.gz $latest_url \
24
+ && tar -xzf ninja.tar.gz \
25
+ && sudo cp ninja /bin/ninja \
26
+ && rm -f ninja.tar.gz ninja
27
+
28
+ # Set the Chinese language environment and do not interact with APT
29
+ ENV LANG=C.UTF-8 DEBIAN_FRONTEND=noninteractive LANG=en-US.UTF-8 LANGUAGE=en-US.UTF-8 LC_ALL=C
30
+
31
+ # Create necessary folders and set access rights
32
+ RUN sudo mkdir -p /.gpt3 /.gpt4 /.auth /.platform && sudo chmod 777 /.gpt3 /.gpt4 /.auth /.platform
33
+
34
+ # By default when running an image, it will run ninja
35
+ CMD ["/bin/sh", "-c", "/bin/ninja run >> /dev/null 2>&1"]