2017-12-29 86 views
1

私はドッキングウィンドウの画像におけるいくつかのパッケージをインストールしようとしていますが、apt-getのコマンドが動作しないようです... apt-getのドッキングウィンドウのコンテナでは動作しませんコマンドを

私はコンテナでこれをしようとするとUbuntuのに基づいて:私はこの

ようDockerfileでこれを実行しようとしました

Err:1 http://archive.ubuntu.com/ubuntu zesty InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Err:2 http://security.ubuntu.com/ubuntu zesty-security InRelease 
    Temporary failure resolving 'security.ubuntu.com' 
Err:3 http://archive.ubuntu.com/ubuntu zesty-updates InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Err:4 http://archive.ubuntu.com/ubuntu zesty-backports InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Reading package lists... Done 
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/zesty-security/InRelease Temporary failure resolving 'security.ubuntu.com' 
W: Some index files failed to download. They have been ignored, or old ones used instead. 
Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
E: Unable to locate package openssh-server 

:16.04

apt-get update && apt-get install -y openssh-server 

私はこれを得ました私は、公式ドキュメントといくつかのフォーラムが、私は私を助け、古い見つかった答えのどれで検索

Sending build context to Docker daemon 2.048kB 
Step 1/3 : FROM ubuntu:16.04 
---> 00fd29ccc6f1 
Step 2/3 : RUN apt-get update && apt-get install openssh-server 
---> Running in ee011c1239d0 
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease 
    Temporary failure resolving 'security.ubuntu.com' 
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Reading package lists... 
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com' 
W: Some index files failed to download. They have been ignored, or old ones used instead. 
Reading package lists... 
Building dependency tree... 
Reading state information... 
E: Unable to locate package openssh-server 
The command '/bin/sh -c apt-get update && apt-get install openssh-server' returned a non-zero code: 100 

:0

FROM ubuntu:16.04 
RUN apt-get update && apt-get -y install openssh-server 
CMD bin/bash 

sudo docker build -t imagetest . 

でこれを構築するが、私はこれを得ました。 ..

ドッカーサービスを再開すると言われた人もいますが、それは私にとってはうまくいきません。 他の人はapt-get update -qqを使用すると言いましたが、それでも機能しません...

私はここで直接質問し、最近の回答を得ました。

ありがとうございました。

+1

ファイアウォールプロキシの背後で実行していますか? – yamenk

+0

いいえ、NAT構成のVMを使用しています – ecavard

+0

ブリッジオプションに切り替えて、問題が解決するかどうかを確認してください。 – yamenk

答えて

1

apt-getがVM上で正常に動作している場合は、ネットワークホストモードを使用してコンテナを構築できます。

docker build --network=host ... 
+0

ありがとう! 最終的にうまくいっています! – ecavard

関連する問題