Logisim_Xpra_Docker/Dockerfile
2021-10-31 10:53:19 +08:00

49 lines
2.5 KiB
Docker

FROM ubuntu:20.04 AS build-xpra
ARG DEBIAN_FRONTEND="noninteractive"
ENV TZ="Asia/Shanghai"
RUN sed -i 's/ports.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& apt update \
&& apt -y install libx11-dev libxtst-dev libxcomposite-dev \
libxdamage-dev libxkbfile-dev python-all-dev pandoc libsystemd-dev \
libgtk-3-dev python3-dev python3-cairo-dev python-gi-dev cython3 xauth \
x11-xkb-utils uglifyjs brotli libjs-jquery libjs-jquery-ui gnome-backgrounds \
python3-rencode python3-lz4 python3-dbus python3-cryptography python3-netifaces \
python3-yaml python3-lzo python3-setproctitle python3-xdg python3-pyinotify \
python3-opencv libpam-dev quilt xserver-xorg-dev xutils-dev \
xserver-xorg-video-dummy xvfb keyboard-configuration python3-kerberos \
python3-gssapi openssh-client sshpass python3-paramiko devscripts \
build-essential lintian debhelper libvpx-dev libx264-dev libwebp-dev \
libturbojpeg-dev libavcodec-dev libavformat-dev libswscale-dev dh-python \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://git.ustc.edu.cn/EE0000/xpra.git
WORKDIR /xpra/
RUN ln -sf ./packaging/debian . \
&& debuild -us -uc -b
WORKDIR /
RUN git clone https://git.ustc.edu.cn/EE0000/xpra-html5.git
FROM ubuntu:20.04
EXPOSE 10000/tcp
ARG DEBIAN_FRONTEND="noninteractive"
ENV TZ="Asia/Shanghai"
RUN sed -i 's/ports.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& apt update \
&& apt -y install wget apt-transport-https gnupg uglifyjs \
&& wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add - \
&& echo "deb https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/deb focal main" > /etc/apt/sources.list.d/adoptopenjdk.list \
&& apt update \
&& apt -y install adoptopenjdk-11-openj9-jre \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt/
COPY --from=build-xpra /xpra_4.2-1_arm64.deb .
RUN apt update \
&& apt -y install ./xpra_4.2-1_arm64.deb \
&& rm -rf /var/lib/apt/lists/*
RUN wget http://home.ustc.edu.cn/~zhaozuohong/logisim-evolution-3.4.1-all.jar && chmod a+r /opt/logisim-evolution-3.4.1-all.jar
COPY --from=build-xpra /xpra-html5/ /xpra-html5/
WORKDIR /xpra-html5/
RUN ./setup.py install /usr/share/xpra/www
RUN useradd -ms /bin/bash logisim
WORKDIR /home/logisim
USER logisim
CMD [ "xpra", "start", "--start-child=java -Xquickstart -Dswing.aatext=TRUE -Dawt.useSystemAAFontSettings=on -jar /opt/logisim-evolution-3.4.1-all.jar", "--bind-tcp=0.0.0.0:10000", "--daemon=no", "--exit-with-children", "--terminate-children", "--resize-display=1024x600" ]