一、FC-web游戏模拟器介绍
FC-web游戏模拟器:这是一个可以在网页上在线玩FC游戏的模拟器!
二、本次实践介绍
1. 本次实践简介
1.本次实践部署环境为个人测试环境;
2.本次实践为快速使用docker部署FC游戏模拟器!
2. 本地环境规划
本次实践环境规划:
hostname | IP地址 | 容器镜像版本 | 操作系统版本 |
---|---|---|---|
jeven| 192.168.3.166 |latest |centos 7.6
三、检查本地Docker环境
1. 检查本地Docker版本
检查Docker版本
[root@jeven ~]# docker version
Client: Docker Engine - Community
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:05:12 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:03:33 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit: v1.1.2-0-ga916309
docker-init:
Version: 0.19.0
GitCommit: de40ad0
2. 检查Docker服务状态
检查Docker服务状态,确保Docker服务正常运行。
[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2023-05-15 20:34:37 CST; 22h ago
Docs: https://docs.docker.com
Main PID: 10133 (dockerd)
Tasks: 25
Memory: 1.1G
四、部署FC模拟器
1. 下载FC游戏容器镜像
由于dockerhub拉取镜像有时很慢,将镜像上传到华为云容器镜像仓库。
[root@jeven ~]# docker pull swr.cn-north-4.myhuaweicloud.com/jeven/jsnes:1.0.0
1.0.0: Pulling from jeven/jsnes
ca3cd42a7c95: Pull complete
de48f30650cc: Pull complete
9f0d5f02d7d1: Pull complete
6254de910146: Pull complete
f38403c80edc: Pull complete
3561442fed51: Pull complete
d5606277284b: Pull complete
886a77f0bd49: Pull complete
28cc8c1e6a6a: Pull complete
142038d67b6b: Pull complete
Digest: sha256:e31e11a2508f52ad69c85bb7a56c143cd4741ebcf571527b87e1618bdd95e7ac
Status: Downloaded newer image for swr.cn-north-4.myhuaweicloud.com/jeven/jsnes:1.0.0
swr.cn-north-4.myhuaweicloud.com/jeven/jsnes:1.0.0
2. 创建FC容器
使用docker-cli快速创建FC游戏模拟器的容器。
docker run --restart always -p 8081:80 --name jsnes -d swr.cn-north-4.myhuaweicloud.com/jeven/jsnes:1.0.0
3. 检查容器运行状态
检查容器的运行状态,确保FC服务的正常运行。
[root@jeven ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
99151bb6c301 swr.cn-north-4.myhuaweicloud.com/jeven/jsnes:1.0.0 "/docker-entrypoint.…" 19 seconds ago Up 17 seconds (healthy) 0.0.0.0:8081->80/tcp, :::8081->80/tcp jsnes
五、访问FC游戏模拟器的web页面
访问FC游戏模拟器首页
访问地址:http://192.168.3.166:8081/