2017-02-16 9 views
0

私たちは、alpine linuxを実行しているdockerコンテナをbambooのビルドエージェントとして使用しています。構築計画の一環として、ドッカー画像を作成する必要があります。アルパインlinuxコンテナ内にビルドドッカーイメージ

ビルドエージェントにはドッカーがインストールされていますが、ドッカーデーモンが実行されていないため、エラーが発生しています。

INFO[0000] libcontainerd: new containerd process, pid: 640 
ERRO[0001] 'overlay' is not supported over overlayfs  
INFO[0001] Graph migration to content-addressability took 0.00 seconds 
INFO[0001] Loading containers: start.     
WARN[0001] Running modprobe bridge br_netfilter failed with message: modprobe: can't change directory to '/lib/modules': No such file or directory 
, error: exit status 1 
WARN[0001] Running modprobe nf_nat failed with message: `modprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1 
WARN[0001] Running modprobe xt_conntrack failed with message: `modprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1 
Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain: Iptables not found 

がしようとすると、私はiptablesのをインストールして、このラウンドを取得するには:

/usr/local/bin/dockerd 

してデーモンを起動すると次のようになります。私は私が手ドッキングウィンドウデーモンを実行しようとすると、今すぐ:

INFO[0000] libcontainerd: new containerd process, pid: 705 
ERRO[0001] 'overlay' is not supported over overlayfs  
INFO[0001] Graph migration to content-addressability took 0.00 seconds 
INFO[0001] Loading containers: start.     
WARN[0001] Running modprobe bridge br_netfilter failed with message: modprobe: can't change directory to '/lib/modules': No such file or directory 
, error: exit status 1 
WARN[0001] Running modprobe nf_nat failed with message: `modprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1 
WARN[0001] Running modprobe xt_conntrack failed with message: `modprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1 
Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain: iptables failed: iptables -t nat -N DOCKER: iptables v1.6.0: can't initialize iptables table `nat': Permission denied (you must be root) 
Perhaps iptables or your kernel needs to be upgraded. 
(exit status 3) 

を私はsudoが高山のものではありませんようになりましたどこへ行くにはほとんどこだわっています。

答えて

1

Dockerコンテナ内でDockerデーモンを実行することは一般的には面倒です。私たちは、このまったく同じ要件を持っている、と我々はドッカー容器にドッカーホストから/var/run/docker.sockを装着することにより、それを解決:

docker run -v /var/run/docker.sock:/var/run/docker.sock --privileged 

ビルドエージェント容器内dockerコマンドは、実際にホスト上ドッカーデーモンに話しているその方法、容器の中ではない。本当にうまく動作します。

+0

このオプションを使用していただきありがとうございます。私は--privilegedで実行する必要はありませんでした – thewire247

関連する問題