Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
perf(dockerfile): wps构建优化,添加启动脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
zjZSTU committed Oct 4, 2019
1 parent aa5826d commit aada034
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dockerfiles/wps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# --name wps \
# wps

FROM ubuntu:18.04
FROM zjzstu/ubuntu:18.04
LABEL maintainer "zhujian <zjzstu@github.com>"

WORKDIR /app
Expand Down
26 changes: 26 additions & 0 deletions dockerfiles/wps/et.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

xhost + > /dev/null

START=$(docker ps -q --filter="name=et")
STOP=$(docker ps -aq --filter="name=et")

if [ -n "${START}" ]
then
docker exec -u user $START et > /dev/null
elif [ -n "${STOP}" ]
then
docker restart ${STOP} > /dev/null
else
docker run -d \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY \
-e LOCAL_USER_ID=`id -u $USER` \
-e XMODIFIERS="@im=fcitx" \
-e QT_IM_MODULE="fcitx" \
-e GTK_IM_MODULE="fcitx" \
-v $HOME/docs:/home/user/Documents \
--name et \
zjzstu/wps:latest \
et > /dev/null
fi
26 changes: 26 additions & 0 deletions dockerfiles/wps/wpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

xhost + > /dev/null

START=$(docker ps -q --filter="name=wpp")
STOP=$(docker ps -aq --filter="name=wpp")

if [ -n "${START}" ]
then
docker exec -u user $START wpp > /dev/null
elif [ -n "${STOP}" ]
then
docker restart ${STOP} > /dev/null
else
docker run -d \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY \
-e LOCAL_USER_ID=`id -u $USER` \
-e XMODIFIERS="@im=fcitx" \
-e QT_IM_MODULE="fcitx" \
-e GTK_IM_MODULE="fcitx" \
-v $HOME/docs:/home/user/Documents \
--name wpp \
zjzstu/wps:latest \
wpp > /dev/null
fi
26 changes: 26 additions & 0 deletions dockerfiles/wps/wps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

xhost + > /dev/null

START=$(docker ps -q --filter="name=wps")
STOP=$(docker ps -aq --filter="name=wps")

if [ -n "${START}" ]
then
docker exec -u user $START wps > /dev/null
elif [ -n "${STOP}" ]
then
docker restart ${STOP} > /dev/null
else
docker run -d \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY \
-e LOCAL_USER_ID=`id -u $USER` \
-e XMODIFIERS="@im=fcitx" \
-e QT_IM_MODULE="fcitx" \
-e GTK_IM_MODULE="fcitx" \
-v $HOME/docs:/home/user/Documents \
--name wps \
zjzstu/wps:latest \
wps > /dev/null
fi

0 comments on commit aada034

Please sign in to comment.