From da75635e26930337cf8593c627d6ff912794bd60 Mon Sep 17 00:00:00 2001 From: pmcgrath Date: Fri, 17 Oct 2014 23:50:40 +0100 Subject: [PATCH] Fixed two issues in the 'Start a Go instance in your app' section and added some content on the CMD instruction. Issue 24 @ https://github.com/docker-library/golang --- golang/README.md | 12 +++++++----- golang/content.md | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/golang/README.md b/golang/README.md index a6e4614d5..de5445a7c 100644 --- a/golang/README.md +++ b/golang/README.md @@ -35,15 +35,17 @@ the build and runtime environment. In your `Dockerfile`, writing something along the lines of the following will compile and run your project: FROM golang:1.3.1-onbuild - CMD ["./myapp"] This image includes multiple `ONBUILD` triggers which should cover most -applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v`, and `RUN -go build -v`. +applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v` and `RUN +go install -v`. -You can then run and build the Docker image: +This image also includes the `CMD ["app"]` instruction which is the default command +when running the image. - docker build -t my-golang-app +You can then build and run the Docker image: + + docker build -t my-golang-app . docker run -it --rm --name my-running-app my-golang-app ## Compile your app inside the Docker container diff --git a/golang/content.md b/golang/content.md index 27700b2c6..c4d7e30fb 100644 --- a/golang/content.md +++ b/golang/content.md @@ -19,15 +19,17 @@ the build and runtime environment. In your `Dockerfile`, writing something along the lines of the following will compile and run your project: FROM golang:1.3.1-onbuild - CMD ["./myapp"] This image includes multiple `ONBUILD` triggers which should cover most -applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v`, and `RUN -go build -v`. +applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v` and `RUN +go install -v`. -You can then run and build the Docker image: +This image also includes the `CMD ["app"]` instruction which is the default command +when running the image. - docker build -t my-golang-app +You can then build and run the Docker image: + + docker build -t my-golang-app . docker run -it --rm --name my-running-app my-golang-app ## Compile your app inside the Docker container