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 1 year has passed since last update.

40代おっさんDockerメモ①

Posted at

本記事について

この記事はプログラミング初学者の私が学んでいく中でわからない単語や概要を分かりやすくまとめたものです。
もし不正などありましたらコメントにてお知らせいただければ幸いです。

Dockerfile

DockerfileはUMLダイアグラムみたいなもの
Dockerイメージを作る設計書

  • FROMでイメージを指定
    • FROM イメージ名前:タグ(主にバージョンを表記するために利用されることが多い)
  • COPYでホストからファイルをイメージにコピー
    • ローカルファイルをコンテナの中にコピーする
    • COPY コピー元 コピー先
  • RUNでシェルコマンドを実行
    • RUN 実行コマンド
  • WORKDIRでコンテナが起動するときのディレクトリの絶対パス(推奨)を指定します
    • WORKDIR 絶対パス
  • ENVで環境変数の設定ができます
    • ENV 環境変数名=値
  • CMDでコンテナ起動時に実行するコマンドとオプションを変更できます。 原則は末尾に記載です。
    • CMD ["実行コマンド", "オプション1", "オプション2"...]
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?