Docker Community Forums

Share and learn in the Docker community.

Import wordpress database


(Tech687) #1
$ cat docker-compose.yml 
version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - dbdata:/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:
            - "8000:80"
        restart: always
        environment:
           WORDPRESS_DB_HOST: db:3306
           WORDPRESS_DB_USER: wordpress
           WORDPRESS_DB_PASSWORD: wordpress

volumes:
    dbdata:


$ docker run -it --rm --volumes-from abc_wordpress_1 --network container:abc_wordpress_1 wordpress:cli db import < resources/wordpress.sql
the input device is not a TTY

Where is the problem?


(Archimedes Trajano) #2

take out -tsince its allocating a TTY.


(Tech687) #3

sorry I did not understand