如何使用GOLang官方图像导入不受欢迎的软件包到Docker?

我已经将这个问题作为imagick git存储库上的一个问题发布了,但是它有一个非常小的用户基础,所以我希望能够从这里获得一些帮助。 我已经尝试了几天现在导入https://github.com/gographics/imagick到Docker使用官方goLang dockerfile为我正在处理的项目,但一直没有成功。 由于这个软件包不太stream行,运行apt-get将不起作用。 我(犹豫)试图只是将文件添加到容器,但没有奏效。 这里是我build立的DockerFile和它产生的错误:=== DOCKERFILE ===

# 1) Use the official go docker image built on debian. FROM golang:latest # 2) ENV VARS ENV GOPATH $HOME/<PROJECT> ENV PATH $HOME/<PROJECT>/bin:$PATH # 3) Grab the source code and add it to the workspace. ADD . /<GO>/src/<PROJECT> ADD . /<GO>/gopkg.in # Trying to add the files manually... Doesn't help. ADD . /opt/local/share/doc/ImageMagick-6 # 4) Install revel and the revel CLI. #(The commented out code is from previous attempts) #RUN pkg-config --cflags --libs MagickWand #RUN go get gopkg.in/gographics/imagick.v2/imagick RUN go get github.com/revel/revel RUN go get github.com/revel/cmd/revel # 5) Does not work... Can't find the package. #RUN apt-get install libmagickwand-dev # 6) Get godeps from main repo RUN go get github.com/tools/godep # 7) Restore godep dependencies WORKDIR /<GO>/src/<PROJECT> RUN godep restore # 8) Install Imagick #RUN go build -tags no_pkgconfig gopkg.in/gographics/imagick.v2/imagick # 9) Use the revel CLI to start up our application. ENTRYPOINT revel run <PROJECT> dev 9000 # 10) Open up the port where the app is running. EXPOSE 9000 

=== END DOCKERFILE ===

这允许我build立docker集装箱,但是当我尝试运行时,在运动学的日志中出现以下错误:

=== DOCKER错误===

 ERROR 2016/08/20 21:15:10 build.go:108: # pkg-config --cflags MagickWand MagickCore MagickWand MagickCore pkg-config: exec: "pkg-config": executable file not found in $PATH 2016-08-20T21:15:10.081426584Z ERROR 2016/08/20 21:15:10 build.go:308: Failed to parse build errors: #pkg-config --cflags MagickWand MagickCore MagickWand MagickCore pkg-config: exec: "pkg-config": executable file not found in $PATH 2016-08-20T21:15:10.082140143Z 

=== END DOCKER ERROR ===