2015-05-27 53 views
0

我有我試圖用它來建立一個Ubuntu的形象與單下面泊塢窗文件。錯誤從Dockerfile建立與單聲道的Ubuntu鏡像安裝

FROM ubuntu:14.04 

MAINTAINER John Smith <[email protected]> 

RUN sudo apt-get update 

RUN sudo /bin/bash -l -c apt-get install wget 

RUN sudo /bin/bash -l -c apt-get http://download.mono-project.com/repo/xamarin.gpg 

RUN sudo apt-key add xamarin.gpg 

RUN sudo echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list 

RUN sudo apt-get update 

RUN sudo apt-get install mono-complete 

當我運行以下命令docker build ...

docker build -t="test/mono" . 

它未能建設,並給出以下錯誤消息:

gpg:can't open 'xamaring.gpg': No such file or directory. 
2015/05/27 16:11:01 The command [/bin/bash -c sudo apt-key add xamarin.gpg] returned a non-zero code: 2 

任何明顯錯誤的伸出來?

回答

2

看起來你忘了使用wget代替apt-get的安裝後,wget的,所以「xamaring.gpg」尚未下載,這就是爲什麼它不能被發現。

你需要這樣的:

/bin/bash -l -c "wget http://download.mono-project.com/repo/xamarin.gpg"