Connect to WordPress Docker Container

I created a Docker Container App on Azure that includes a WordPress container and a MySQL container. When I run the following command:

docker run ps

I see the two containers.

  • Docker Debian apt Error Reading from Server
  • CMD dockerfile is not executed
  • Windows 7 - Error: connect ENOENT //./pipe/docker_engine
  • Docker Error: container id followed by “command not found”
  • WordPress project setup - Trellis, Valet or Docker?
  • Load kernel module from mac os sierra host to a docker container
  • enter image description here

    I can connect to the MySQL container file system using this command:

    docker run -i -t mysql:latest /bin/bash

    If I try to connect to the WordPress container file system using the same command, such as…

    docker run -i -t wordpress:latest /bin/bash

    …it doesn’t work. Instead it gives me this message:

    Did you forget to –link some_mysql_container:mysql or set an
    external db with -e WORDPRESS_DB_HOST=hostname:port?

    It makes sense I guess that it want’s me to reference the MySQL container. But, I’ve tried various versions of –link and cannot get it to work.

    Can someone help me with the Docker syntax? I just want to make some changes to the file system in this container.

    Thanks in advance!

  • why run exec command?
  • Why is apt-get update failing inside of a docker container?
  • Elasticsearch\Common\Exceptions\BadRequest400Exception No handler found for uri [/indexsearch] and method [POST]
  • Move file downloaded in Dockerfile to harddrive
  • Docker/Rails - Permission denied @ dir_s_mkdir Errno::EACCESS
  • GitLab CE Docker SMTP
  • 2 Solutions collect form web for “Connect to WordPress Docker Container”

    On the other side, if you need to run WordPress container in interactive mode (as you attempted), you’ll need to specify the –link like this:

    docker run --link compose990242913_mysql_1:mysql -i -t wordpress:latest /bin/bash

    when you do docker run ... you are not connecting to the running containers displayed by the docker ps command. What you are actually doing is creating and running additional containers from the docker images mysql:latest and wordpress:latest.

    If you want to open a bash shell in the running container named compose990242913_wordpress_1 then you need to execute the following command:

    docker exec -i -t compose990242913_wordpress_1 /bin/bash

    Once you are in that shell, make sure to quit properly by typing the exit command or you might leave processes behind in that container.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.