Build a browser-based DOS nostalgic game library using Docker
本文最后更新于 171 天前,其中的信息可能已经有所发展或是发生改变,如有失效可到评论区留言。
Article Abstract
When building a browser-based DOS nostalgic game library based on Docker, you need to first initialize the container with the 42 games built into the image, and then migrate the game files to the host mount directory for subsequent expansion. The deployment process requires phased operations: after starting the container without mounting for the first time, copy the internal game resources to the local directory, delete the container, and then remount it to achieve persistent management. This solution solves the problem of game loss caused by direct mounting. Public network access can be achieved through reverse proxy configuration, adapting to different network environments such as home broadband and cloud hosts. As an extension of the "Game World" series of content, this project combines Docker containerized deployment with Web-side game simulation technology to provide a lightweight deployment solution for nostalgic game experiences.
Qwen3-14B · 2026-06-18

Preface

Continued from the previous article on building a nostalgic emulator (see article:Deploying Web-based Retro Game Emulator Using Docker Based on emulatorjs), I continued to look for similar interesting projects built with Docker to enrich the "Game World" section of my blog. After some searching, I found this project on GitHub: rwv/chinese-dos-games. A netizen made it into a Docker image: oldiy/dosgame-web-docker, so this time I will use it to build the Docker container.

Deploy dosgame

Since this Docker image has 42 built-in games stored in the `/app/static/games` directory inside the container, you cannot directly use the `-v` parameter to mount the host folder to the `/app/static/games` directory during the first startup. Because the host folder is empty, mounting it directly will cause these games to disappear (actually, it's not impossible, but then you would need to manually add each game). Therefore, the correct steps are to deploy without the `-v` parameter first. After Docker runs successfully, copy the contents of `/app/static/games` to the host's mount folder, delete the Docker container, and then redeploy the container with the `-v` parameter. This way, if you want to add games in the future, you can operate directly in the host's mount directory.

Deploy directly without the -v parameter

docker run -d --name dosgame -p 262:262 oldiy/dosgame-web-docker:latest

Copy the /app/static/games folder inside the container to /docker/dosgame/games on the host

mkdir -p /docker/dosgame
docker cp dosgame:/app/static/games /docker/dosgame

Delete the created container

docker stop dosgame
docker rm dosgame

Redeploy with the -v parameter

docker run --name dosgame -d --restart=always \
  -p 262:262 \ #映射端口根据自己实际情况修改
  -v /docker/dosgame/games:/app/static/games \ #将宿主机的对应文件夹挂载到容器
  oldiy/dosgame-web-docker:latest

Access the game

Usehttp://宿主机IP:262Access the game:

image.png

The default games provided are as follows:
image.png

image.png

The interface of The Legend of Sword and Fairy:
image.png

Some games do not support the mouse, such as The Legend of Sword and Fairy; some do, such as Richman 3, which you can explore on your own. General keyboard keys: Enter to confirm, Shift to select, ↑ ↓ ← → for directions, Z and X correspond to controller B and A, and sometimes Space is also for selection. You can try them out.

For me, just to experience some nostalgia, 42 games are more than enough. For the actual experience, please visit the blog's "Game World" - "Invincible DOS Game Library", or you can click directly:Invincible DOS Game Library。

Configure public network access

If you want to publish to the public network, you need to choose the most suitable publishing method based on your actual environment and the reverse proxy you use. You can refer to several of my previous articles:
1、Docker Series: Building Your Own Reverse Proxy Based on NPM Using Docker
2、Linux Panel Series: Configuring Reverse Proxy and Publishing Using Non-443 Ports
3、Home Data Center Series: Getting Cloudflare for Free via Domestic ICP-Filed Cloud Hosts to Achieve Fast Access to Domestic Sites from Abroad
4、Home Data Center Series: Getting Cloudflare for Free via Home Broadband Without Public IP to Achieve Fast Website Building (Universal)

Among them, the 1st and 2nd methods are suitable for environments with a public IP but without a legal 443 port (home broadband, non-filed cloud hosts), where non-standard ports need to be added after the URL (if using Cloudflare to build a website, no port needs to be added, but you need to customize the origin server port, which you can refer to:Home Data Center Series: Solving the Problem of Having a Public IP but No Legal 80 or 443 Ports for Website Building via Cloudflare's Origin Rules). The 3rd method is suitable for cloud hosts with ICP filing, and the 4th method is suitable for all environments (including environments without a public IP), which is also my recommended method (regardless of whether your environment has a public IP, because this method does not require running HTTPS traffic directly on the public network).

View Related Categories · 3 Matches
📌 Content Structure Prompt:
This content is part of the following knowledge map, where you can view the complete content path: Blog Knowledge Map。
📎 Related Articles
Share this article
The blog content is original, please indicate the source when reposting! The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if needed, you can join theTelegram Groupto discuss questions together.
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗ
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Kaomoji
Emoji
Little Dinosaur
Flower!
Previous
Next
       

👋 Welcome to “Wudi's Personal Blog”

Here, long-term exploration is mainly carried out around the following directions:

🧱 Personal Digital Infrastructure and Blog System Construction
☁️ Cloudflare and Network Architecture Practice
🧠 AI and Knowledge System Exploration
🛡️ Network Security and Access Optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspectives and Worldviews