Oreshiki docker-compose cheat sheet

At startup

  1. Click the docker-for-mac icon

  2. Launch container (-d: Launch in background) --Docker-compose.yml moves to a certain hierarchy
    docker-compose up -d

  3. Enter the container ```docker-compose exec service name /bin/bash````

Example


docker-compose exec web /bin/bash

When finished

  1. Exit from service exit

  2. Check the currently running service to determine which service (container) to end. docker ps

  3. Stop service (container) (= end) * If you compare it with vagrant, vagrant halt

docker stop `container id`

Example


docker stop 5efheiwoe

appendix

Check all the containers created docker ps -a

--Delete the container you no longer need docker rm -f` CONTAINER ID`

b. Check all created images docker images

--Delete images you no longer need docker rmi -f` IMAGE ID`

rails new

  1. rails new folder name --database = postgresql
  2. Edit database.yml

config/database.yml


   default: &default
  adapter: postgresql
  encoding: unicode
  host: db
  username: postgres
  password: password
  pool: 5
  1. rails db:create

---- Start work! !! !! !! ----

Recommended Posts

Oreshiki docker-compose cheat sheet
Java cheat sheet
JMeter cheat sheet
Kotlin cheat sheet
[Docker cheat sheet]
Mockito + PowerMock cheat sheet
Eclipse Collections cheat sheet
Rails Tutorial cheat sheet
Spring Boot2 cheat sheet
SCSS notation cheat sheet
Docker command cheat sheet
Java Stream API cheat sheet
[Eclipse] Shortcut key cheat sheet
C # cheat sheet for Java engineers
Competitive programming private cheat sheet (Java)
javac, jar, java command cheat sheet
Getting Started with Doma-Criteria API Cheat Sheet
Technology for reading source code (cheat sheet)
[Java] Data type / string class cheat sheet
Basic cheat sheet by language (Ruby, PHP)