Docker Community Forums

Share and learn in the Docker community.

Building containers after prune no longer working

Hello.

I’m trying to get wordpress running through docker. I was able to initially get a container running, but found I needed to make changes. Made changes. rm’d the containers and found old data still there, not reliable. rm’d the containers and ran a purge. since then, any containers I create say they are starting, but don’t return anything when I try to connect with them.

Any ideas or suggestions?

Steps to reproduce:

vi docker-compose.yml
sudo docker-compose up -d --build

[usable here, find out settings not right]

sudo docker container list
sudo docker container stop 158f9db47e8f

[make changes here]
vi docker-compose.yml
sudo docker-compose up -d --build

[data corrupt]
sudo docker container list
sudo docker container stop [container list]
sudo docker container rm [container list]
sudo docker image list
sudo docker image rm [image list]
sudo docker system prune -a

[start over]
sudo docker-compose up -d --build
[can't even connect, just get blank screen]

No matter how many times I do the above, I can no longer get containers working properly. Docker does not through any errors to the command line.

Thanks,

Harlan…

Hi Harlan,

Not enough information. We have no clue about your docker compose file or what you do in that one to make it work.

docker-compose.yml:
version: ‘3.3’

services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: aaaa
MYSQL_DATABASE: bbb
MYSQL_USER: ccc
MYSQL_PASSWORD: ddd

wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- “8000:80”
restart: always
environment:
MYSQL_ROOT_PASSWORD: fff
MYSQL_DATABASE: aaa
MYSQL_USER: bbb
MYSQL_PASSWORD: ccc

wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- “8000:80”
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: yyy
WORDPRESS_DB_PASSWORD: xxx
WORDPRESS_DB_NAME: zzz
volumes:
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
volumes:
db_data: {}

uploads.ini:
file_uploads = On
memory_limit = 500M
upload_max_filesize = 5000M
post_max_size = 500M
max_execution_time = 600

Host: Ubuntu 18.04, kept updated

I connect to http://localhost:8000 or via the direct ip address, also at port 8000. But still nothing shows up.

Anyone have any ideas or suggestions? Need any other information I may have forgotten?

Hi.

So how far are you getting now?
can you get the containers running?
if not, can you get a basic container to work using “docker run …” ?

HI,
The containers are running:

$ docker container list
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
cc9d44fd75a6        wordpress:latest    "docker-entrypoint.s…"   6 days ago          Up 5 days           0.0.0.0:8000->80/tcp   wordpress_wordpress_1
524ca904465d        mysql:5.7           "docker-entrypoint.s…"   6 days ago          Up 5 days           3306/tcp, 33060/tcp    wordpress_db_1

Right now I’m seeing a couple of problems:

  1. When I try to connect to the website for Wordpress, I just get a blank screen.
  2. Again when trying to connect to http://localhost:8000 I get routed to my localhost’s ip address instead of just 127.0.0.1

I’m not sure if they are related, but in any case I’m not able to connect to Wordpress like I was able to until I made some changes.

Does this help?

Any other info I can provide?

Thanks,

Harlan…

Hi,
When I view the page source, there is nothing there! No code of any kind showing up!

Any suggestions on why this could be happening or how to fix it?

Thanks,

Harlan…

Have you tried looking at the logs?
“docker logs ContainerID / NAME”