LoginSignup
18
18

More than 5 years have passed since last update.

Dockerfileのプロキシ定義

Posted at

まだまだDocker本家のサンプルを動かしています。
現在はここ: http://docs.docker.com/linux/step_four/

Dockerfileを作ってビルドをするところです。
なにやらまたproxyにハマりました。

Dockerfileの作成


FROM docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay

イメージのビルドをすると、ログらしきログが出ることもなく止まる…。


$ docker build -t docker-whale .
Sending build context to Docker daemon 2.048 kB
Step 0 : FROM docker/whalesay:latest
 ---> ded5e192a685
Step 1 : RUN apt-get -y update && apt-get install -y fortunes
 ---> Running in 8141845dddea

proxy設定がないことに気づく!

下記のようにプロキシの設定を追加してあげたら無事成功!


FROM docker/whalesay:latest

ENV https_proxy "http://~~~"
ENV http_proxy "http://~~~"

RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay
18
18
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
18
18