1、安装Ubuntu

Ubuntu系统推荐使用 ubuntu-22.04.4-desktop-amd64.iso,这个版本的镜像在Vmware中搭建不会出现VmwareTools失效问题。

安装完之后Ubuntu一定要换源,虽然不换的时候在更新软件依赖有时候会使用清华源,但是不稳定。把Ubuntu自带的镜像源全部注释掉,使用清华源,安装软件速度飞起

清华源Ubuntu地址:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

2、安装docker

这个直接使用Vulhub官网的安装方法就行


curl -s https://get.docker.com/ | sh

安装docker-compose这一步是个坑

因为上一步安装docker,安装的是最新版本的docker,而docker-compose现在已经是第二版了,官网还是第一版,安装后使用命令会报错。因为docker和docker-compose版本不匹配。
使用下面命令下载最新版。

apt-get install docker-compose-plugin

#命令使用不是用docker-compose
docker compose version
docker compose --help
docker compose build
docker compose up -d
docker compose down

3、docker换源

推荐docker换成aliyun的镜像源,因为用其他的镜像源,在build这一环节出现老是超时。而我换成aliyun的就不会有这种情况。

vim /etc/docker/daemon.json

内容:

{
    "registry-mirrors": [
        "https://XXX.mirror.aliyuncs.com",
        "https://hub.docker.com/",
        "https://docker.mirrors.ustc.edu.cn"
    ]
}

阿里云镜像源申请方法网上都是,这里就不提供了。

4、docker-compose.yml version问题

WARN[0000] /gws/vulhub/httpd/CVE-2021-40438/docker-compose.yml: `version` is obsolete 

这个警告不用管,不会对 build 产生影响