From: Hraban Luyat Date: Mon, 26 Dec 2016 15:30:14 +0000 (+0000) Subject: README: How to use in dockerized app X-Git-Tag: v2.0.0~42 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=7c11c8a92fdb1d88bb4ffeddfa8ee8630b2b75f2;p=go-opus.git README: How to use in dockerized app --- diff --git a/README.md b/README.md index 30a897b..120e786 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,35 @@ Mac: brew install pkg-config opus opusfile ``` +### Using in Docker + +If your Dockerized app has this library as a dependency (directly or +indirectly), it will need to install the aforementioned packages, too. + +This means you can't use the standard `golang:*-onbuild` images, because those +will try to build the app from source before allowing you to install extra +dependencies. Instead, try this as a Dockerfile: + +```Dockerfile +# Choose any golang image, just make sure it doesn't have -onbuild +FROM golang:1 + +RUN apt-get update && apt-get -y install libopus-dev libopusfile-dev + +# Everything below is copied manually from the official -onbuild image, +# with the ONBUILD keywords removed. + +RUN mkdir -p /go/src/app +WORKDIR /go/src/app + +CMD ["go-wrapper", "run"] +COPY . /go/src/app +RUN go-wrapper download +RUN go-wrapper install +``` + +For more information, see . + ### Linking libopus and libopusfile The opus and opusfile libraries will be linked into your application