1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker-compose memo

1
Last updated at Posted at 2020-01-23

docker-compose

docker-composeで云々のとき

docker-composeで立ち上げてるservice名を知りたいとき

docker-compose ps --service

起動中のcontainerに入りたいとき

dockerコマンドで入るとき

コンテナ名で入る

docker exec -it <container_name> bash

docker-composeコマンドで入るとき

サービス名で入る

docker-compose exec <service_name> bash

[ERROR]

port is already allocated

portがもう使われてるとき

$ lsof -i:<Port番号>
$ kill <>

$ lsof -i:3306
$ kill 11111 ## PIDが11111のとき

docker-compose.yml


version: '2'

services:
### web container ###
  web:
    build:
    container_name: "web"
    ports:
     - "8080:80"
    volumes:

### redis container ###
  redis:
    image: redis

### mysql container ###




1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?