Help us understand the problem. What is going on with this article?

Dockerfile

More than 3 years have passed since last update.

これ使いこなせないなら生lcxで良いような、、、

Docker user guide抜粋

Dockerfile
# This is a comment
#命令        命令文
FROM ubuntu:14.04
MAINTAINER myname <myname@exsample.com>
RUN apt-get -qq update
RUN apt-get -qqy install ruby ruby-dev
RUN gem install sinatra
code
  • FROM
    Docker に対してソースとなるイメージ
  • MAINTAINER
    イメージ管理人
  • RUN
    イメージの中で実行するコマンド
  • ADD
    ローカルファイルシステムのファイルやディレクトリをDockerイメージにコピー ローカルにあるmyfile.txtをイメージの/myfile.txtにコピー
    ADD myfile.txt /
    コンテキスト内のみ可能
  • CMD
    コンテナーの実行コマンド(docker run)
    CMD ["/usr/local/bin/run.sh"]を記述しておくと docker run -i run_imageで起動すると/usr/local/bin/run.shスクリプトを実行 docker run -i run_image /usr/local/bin/run.shと同じ
  • ENTRYPOINT
    コンテナーの実行コマンド
  • WORKDIR
    作業ディレクトリの指定
  • ENV
    環境変数の指定
  • USER
    実行ユーザーの指定
  • EXPOSE
    ポートのエクスポート
  • VOLUME
    ボリュームのマウント

build

docker build -t="(所属)/(名前):(タグ)" .
Dockerfile を . で指示

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした