現時点利用できるコマンド一覧 Commands: build Build or rebuild services convert Converts the compose file to platform's canonical format create Creates containers for a service. down Stop and remove containers, networks events Receive real time events from containers. exec Execute a command in a running container. images List images used by the created containers kill Force stop service containers. logs View output from containers ls List running compose projects pause pause services port Print the public port for a port binding. ps List containers pull Pull service images push Push service images restart Restart containers rm Removes stopped service containers run Run a one-off command on a service. start Start services stop Stop services top Display the running processes unpause unpause services up Create and start containers
コンテナにアタッチする MacbookPro13% docker compose exec db mysql -uwordpress -pwordpress -Dwordpress mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.33 MySQL Community Server (GPL) Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>