first commit
This commit is contained in:
commit
69cbfff5eb
3 changed files with 78 additions and 0 deletions
49
Dockerfile
Normal file
49
Dockerfile
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
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" ]
|
2
README.md
Normal file
2
README.md
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# logisimOnline
|
||||||
|
# logisimOnline
|
27
test.py
Executable file
27
test.py
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import time
|
||||||
|
|
||||||
|
import docker
|
||||||
|
client = docker.from_env()
|
||||||
|
|
||||||
|
#container_list = []
|
||||||
|
|
||||||
|
"""
|
||||||
|
for i in range(0, 10):
|
||||||
|
print(f"Creating container {i}")
|
||||||
|
container = client.containers.run("zhaozuohong/logisim", detach=True, remove=True, ports={"10000/tcp": 60000 + i})
|
||||||
|
container_list.append(container)
|
||||||
|
"""
|
||||||
|
|
||||||
|
print(f"Creating container...")
|
||||||
|
|
||||||
|
container = client.containers.run("zhaozuohong/logisim", detach=True, remove=True, ports={"10000/tcp": 60000})
|
||||||
|
time.sleep(3)
|
||||||
|
while True:
|
||||||
|
#while (container.status == "running"):
|
||||||
|
time.sleep(2)
|
||||||
|
container.reload()
|
||||||
|
print(container.status)
|
||||||
|
|
||||||
|
print("container stopped.")
|
||||||
|
#container_list.append(container)
|
Loading…
Reference in a new issue