无需在Linux系统上下载约600个依赖来安装Wine,试试这个镜像!
这个方案的需求源于在Ubuntu 18.04上运行《炉石传说》(Hearthstone)的需求,同时避免安装Wine的数百个依赖。受LinuxConfig.org关于在Ubuntu安装暴雪战网的文章、ROS.org关于Docker与XServer配合使用的教程及其他研究启发,最终形成了此镜像。
支持的标签及对应的Dockerfile链接
稳定版(Stable)
- https://github.com/igorbrites/wine/blob/master/stable/Dockerfile
- https://github.com/igorbrites/wine/blob/master/stable/Dockerfile
- https://github.com/igorbrites/wine/blob/master/stable/Dockerfile
测试版(Staging)
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
- https://github.com/igorbrites/wine/blob/master/staging/Dockerfile
开发版(Devel)
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
- https://github.com/igorbrites/wine/blob/master/devel/Dockerfile
基础镜像(Base)
其他镜像使用的基础镜像:
- https://github.com/igorbrites/wine/blob/master/base/Dockerfile
如何获取镜像
构建镜像
克隆GitHub仓库并运行构建命令:
bash
docker build -t igorbrites/wine[:version] .
拉取镜像
直接从Docker Hub拉取:
bash
docker pull igorbrites/wine[:version]
如何使用镜像
步骤1:创建数据卷
创建卷以存储Wine在用户主目录生成的所有数据:
bash
docker volume create wine
Step 2:运行容器
运行容器并指定要执行的应用:
bash
# 共享X11服务器所需配置
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist "$DISPLAY" | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run -it \
--rm \
# 挂载当前目录到容器内的应用目录
--volume="$(pwd):/home/wine/Apps" \
# 挂载wine卷存储用户数据
--volume=wine:/home/wine \
# 共享X11服务器的卷
--volume=$XSOCK:$XSOCK:rw \
--volume=$XAUTH:$XAUTH:rw \
--env="XAUTHORITY=${XAUTH}" \
--env="DISPLAY" \
# 容器内使用的用户
--user="wine" \
# 工作目录设为当前目录
--workdir=/home/wine/Apps \
--net host \
--name wine \
igorbrites/wine[:version] wine64 MyAwesomeApp.exe
步骤3:使用脚本简化操作
可以使用仓库中的run脚本(默认使用latest版本):
- 进入容器bash环境:
./run bash
- 直接运行已知路径的应用:
./run wine64 /path/to/app.exe
注意事项
应用安装后,运行时需注意路径。可通过./run bash进入容器查看应用安装位置,再用wine64命令启动;或直接指定容器内的完整路径运行。