【Docker】Dockerで簡単にpython開発環境を構築する
前回に引き続き、Dockerを使ってpython開発環境を構築してみました。
(といっても簡単なインタラクティブシェルですが)
DockerHubのイメージをpull
DockerHubがpython入りのイメージを配布していたので、これを使ってみようと思いました。
docker pull
でイメージをpullし、ローカルに追加します。
$ docker pull python Using default tag: latest latest: Pulling from library/python 4176fe04cefe: Pull complete 851356ecf618: Pull complete 6115379c7b49: Pull complete aaf7d781d601: Pull complete 40cf661a3cc4: Pull complete 975fe2fd635f: Pull complete bf4db784e7fd: Pull complete 0491f7e9426b: Pull complete Digest: sha256:bf0718e2882cabc144c9c07d758b09c65efc104a6ddc72a9a976f8b26f67c2ee Status: Downloaded newer image for python:latest
全てPull completeになったらpull完了。
docker images
で確認します。
REPOSITORY TAG IMAGE ID CREATED SIZE <none> <none> e13980182719 2 days ago 224MB python latest 336d482502ab 9 days ago 692MB ubuntu 14.04 dc4491992653 4 weeks ago 222MB
二行目に確認できました。
コンテナを生成
次に、pullしたイメージからコンテナを生成します。
生成方法は前回投稿したDockerの記事同様docker run
。
# コンテナ生成 $ docker run -t python $ docker run -t python Python 3.6.4 (default, Feb 17 2018, 09:32:33) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>>