This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM zjzstu/deepin-wine:latest | ||
LABEL maintainer "zhujian <zjzstu@github.com>" | ||
|
||
WORKDIR /app | ||
RUN set -eux && \ | ||
apt-get update && \ | ||
apt-get install -y wget ttf-wqy-microhei gosu dbus && \ | ||
gosu nobody true && \ | ||
wget https://mirrors.aliyun.com/deepin/pool/non-free/d/deepin.com.thunderspeed/deepin.com.thunderspeed_7.10.35.366deepin18_i386.deb && \ | ||
useradd -s /bin/bash -m user && \ | ||
chown -R user:user /app && \ | ||
dpkg -i *.deb && \ | ||
rm -f *.deb && \ | ||
apt-get autoclean -y && apt-get clean -y && \ | ||
find /var/lib/apt/lists -type f -delete && \ | ||
find /var/cache -type f -delete && \ | ||
find /var/log -type f -delete && \ | ||
find /usr/share/doc -type f -delete && \ | ||
find /usr/share/man -type f -delete | ||
|
||
COPY docker-entrypoint.sh ./ | ||
RUN chmod a+x docker-entrypoint.sh && \ | ||
chown user:user docker-entrypoint.sh | ||
ENTRYPOINT ["/app/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
if [ "$(id -u)" -eq '0' ] | ||
then | ||
UID=${UID:-9001} | ||
GID=${GID:-9001} | ||
AUDIO_GID=${AUDIO_GID:-9002} | ||
VIDEO_GID=${VIDEO_GID:-9003} | ||
id | ||
usermod -u ${UID} -g ${GID} -a -G root,${AUDIO_GID},${VIDEO_GID} user > /dev/null 2>&1 | ||
|
||
source dbus start > /dev/null 2>&1 | ||
export HOME=/home/user | ||
chown -R ${UID}:${GID} ${HOME} > /dev/null 2>&1 | ||
exec gosu user "$0" "$@" | ||
fi | ||
|
||
APP="ThunderSpeed" | ||
APP_NAME="Thunder.exe" | ||
|
||
/opt/deepinwine/apps/Deepin-${APP}/run.sh > /dev/null 2>&1 | ||
sleep 30s | ||
|
||
while test -n "`pidof ${APP_NAME}`" | ||
do | ||
sleep 1s | ||
done | ||
exit "$?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
APP="ThunderSpeed" | ||
COMMAND="/opt/deepinwine/apps/Deepin-${APP}/run.sh" | ||
CONTAINER_NAME="thunder" | ||
IMAGE_NAME="zjzstu/thunder:latest" | ||
|
||
HOST_FILE_DIR="${HOME}/deepin-wine/${APP} Files" | ||
CONTAINER_FILE_DIR="/home/user/${APP} Files" | ||
|
||
# 启动wechat镜像 | ||
function startup() | ||
{ | ||
docker run \ | ||
--device=/dev/snd:/dev/snd \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
-e DISPLAY=unix${DISPLAY} \ | ||
-e AUDIO_GID=`getent group audio | cut -d: -f3` \ | ||
-e VIDEO_GID=`getent group video | cut -d: -f3` \ | ||
-e GID=`id -g` \ | ||
-e UID=`id -u` \ | ||
-e XMODIFIERS="@im=fcitx" \ | ||
-e QT_IM_MODULE="fcitx" \ | ||
-e GTK_IM_MODULE="fcitx" \ | ||
-v "${HOST_FILE_DIR}":"${CONTAINER_FILE_DIR}" \ | ||
--name ${CONTAINER_NAME} \ | ||
-d ${IMAGE_NAME} > /dev/null 2>&1 | ||
} | ||
|
||
function run() | ||
{ | ||
xhost + > /dev/null 2>&1 | ||
|
||
START=$(docker ps -q --filter="name=${CONTAINER_NAME}") | ||
STOP=$(docker ps -aq --filter="name=${CONTAINER_NAME}") | ||
|
||
echo $START | ||
echo $STOP | ||
if [ -n "${START}" ] | ||
then | ||
docker exec -d -u user $START ${COMMAND} > /dev/null 2>&1 | ||
elif [ -n "${STOP}" ] | ||
then | ||
docker restart ${STOP} > /dev/null 2>&1 | ||
else | ||
echo "startup" | ||
startup | ||
fi | ||
} | ||
|
||
function main() | ||
{ | ||
run | ||
exit "$?" | ||
} | ||
|
||
main |