我正在尝试根据 Dockers 网站上的官方文档运行docker-compose up -d
wordpressdocker-compose.yml
配置。它没有运行任何东西,只是返回以下内容wordpress_db_1 is up-to-date wordpress_wordpress_1 is up-to-date
这是我的配置
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8080:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
db_data: {}
这是我正在关注的文档https://docs.docker.com/compose/wordpress/
我检查了 wordpress 是否恰好在 localhost:8000 上运行,因为它说它会运行,但是什么也没有。
我刚刚将 docker 重置为出厂设置,然后再次运行相同的命令,结果如下,但是仍然没有运行localhost:8000
PS C:\Users\andersk\sites\wordpress> docker-compose up -d
Creating network "wordpress_default" with the default driver
Creating volume "wordpress_db_data" with default driver
Pulling db (mysql:5.7)...
5.7: Pulling from library/mysql
a5a6f2f73cd8: Pull complete
936836019e67: Pull complete
283fa4c95fb4: Pull complete
1f212fb371f9: Pull complete
e2ae0d063e89: Pull complete
5ed0ae805b65: Pull complete
0283dc49ef4e: Pull complete
a7905d9fbbea: Pull complete
cd2a65837235: Pull complete
5f906b8da5fe: Pull complete
e81e51815567: Pull complete
Pulling wordpress (wordpress:latest)...
latest: Pulling from library/wordpress
a5a6f2f73cd8: Already exists
633e0d1cd2a3: Pull complete
fcdfdf7118ba: Pull complete
4e7dc76b1769: Pull complete
c425447c8835: Pull complete
75780b7b9977: Pull complete
33ed51bc30e8: Pull complete
7c4215700bc4: Pull complete
d4f613c1e621: Pull complete
de5465a3fde0: Pull complete
6d373ffaf200: Pull complete
991bff14f001: Pull complete
d0a8c1ecf326: Pull complete
aa3627a535bb: Pull complete
a36be75bb622: Pull complete
98ebddb8e6ca: Pull complete
ed6e19b74de1: Pull complete
18b9cc4a2286: Pull complete
dfe625c958ac: Pull complete
Creating wordpress_db_1 ... done
Creating wordpress_wordpress_1 ... done
当我运行时,docker-machine ip MACHINE_VM
我得到以下返回
Docker machine "MACHINE_VM" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one.
最后,当我docker-machine ls
按照要求运行时,我只会NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
返回
答案1
这太愚蠢了,我docker-composer.yml
从这里复制了它https://hub.docker.com/_/wordpress/然后按照这里的说明进行操作https://docs.docker.com/compose/wordpress/他们设置了不同的端口,8080
所以我只需在浏览器中8000
输入,它就被设置为omg,太愚蠢了。8000
8080