使用docker搭建ASF挂卡

博客半年没更新了,一直学习专业知识和摄影,都快忘记了(主要是懒

仓库地址:https://hub.docker.com/r/justarchi/archisteamfarm


 

安装docker

#CentOS 6
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum update -y
yum -y install docker-io
service docker start
chkconfig docker on

#CentOS 7、Debian、Ubuntu
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker


 

搭建ASF

  • 拉取ASF镜像
docker pull justarchi/archisteamfarm
  假设想要映射出来的目录为/root/asf,则需要新建目录:
mkdir -p /root/asf                #新建目录
chmod 777 /root/asf                #给权限
然后上传三个ASF.json bot.json IPC.config配置文件到新建的目录中。不过我直接上传我旧版的ASF.json bot.json也能运行
  • 启动ASF
docker run -it -v /root/asf:/app/config --name asf justarchi/archisteamfarm
这样会直接进入容器,然后会让你输入手机令牌,这样就大功告成了

如果想进入容器可以

docker attach 容器ID
或者
docker exec -it 容器ID /bin/bash 

 

结尾

之前写过Ubuntu/Debian一键安装运行ASF挂卡脚本但是需要screen,而且不适用centos,还是docker方便。改配置文件还可以实现挂游戏时长,详情可以参考Linux使用ASF挂游戏时长