0
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 3 years have passed since last update.

DockerでRailsのセットアップ

Last updated at Posted at 2020-07-21

① develop > docker > app名(test) を作成

② test内に、'dockerfile'、'docker-compose.yaml'を作成

③ 'dockerfile'編集

dockerfile
FROM ruby:2.6.6-stretch

Docker は Dockerfile から命令を読み込んで、自動的にイメージをビルドします。 Dockerfile はテキストファイルであり、イメージを作り上げるために実行するコマンドラインコマンドを、すべてこのファイルに含めることができます。 docker build を実行すると、順次コマンドライン命令を自動化した処理が行われて、ビルド結果となるイメージが得られます。

④ 'docker-compose.yaml'編集

docker-compose.yaml
version: '3'
services:
  app:
    build: .
    volumes:
      - ".:/app"
    ports:
      - "3000:3000"
    tty: true

⑤ ターミナル

docker-compose up
# コンテナの起動・構築

6 コンテナを作成して起動からログインしてbashで操作

docker exec -it SAMPLE_APP_1 /bin/bash

Dockerでよく使うコマンドまとめ

https://designsupply-web.com/media/knowledgeside/3325/

チートシート

https://qiita.com/eighty8/items/0288ab9c127ddb683315

0
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
0
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?