From da75635e26930337cf8593c627d6ff912794bd60 Mon Sep 17 00:00:00 2001 From: pmcgrath Date: Fri, 17 Oct 2014 23:50:40 +0100 Subject: [PATCH 1/6] 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 a6e4614d..de5445a7 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 27700b2c..c4d7e30f 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 From 459625e0384194d7a1b9c051d97f6c13f8b8f3ff Mon Sep 17 00:00:00 2001 From: pmcgrath Date: Sun, 19 Oct 2014 12:05:00 +0100 Subject: [PATCH 2/6] Restored comma as suggested by the code style guide, thanks tianan --- golang/content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golang/content.md b/golang/content.md index c4d7e30f..7e2383ae 100644 --- a/golang/content.md +++ b/golang/content.md @@ -21,7 +21,7 @@ the lines of the following will compile and run your project: FROM golang:1.3.1-onbuild 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 +applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v`, and `RUN go install -v`. This image also includes the `CMD ["app"]` instruction which is the default command From 78f95032a18e85a667c93358dba9b55f0ef1e869 Mon Sep 17 00:00:00 2001 From: pmcgrath Date: Sun, 19 Oct 2014 12:08:58 +0100 Subject: [PATCH 3/6] Restored comma as suggested by the code style guide, thanks tianan --- golang/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golang/README.md b/golang/README.md index de5445a7..6ec0068f 100644 --- a/golang/README.md +++ b/golang/README.md @@ -37,7 +37,7 @@ the lines of the following will compile and run your project: FROM golang:1.3.1-onbuild 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 +applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v`, and `RUN go install -v`. This image also includes the `CMD ["app"]` instruction which is the default command From 9e53ea71fa9e6f0a71a72530df8bb7c5f17515c2 Mon Sep 17 00:00:00 2001 From: pmcgrath Date: Sun, 19 Oct 2014 12:24:53 +0100 Subject: [PATCH 4/6] Restored the CMD instruction to the Dockerfile and removed the CMD instruction explanation, this is a bit of a simplification but is a simplier explanation for a newbie --- golang/README.md | 4 +--- golang/content.md | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/golang/README.md b/golang/README.md index 6ec0068f..b46170d6 100644 --- a/golang/README.md +++ b/golang/README.md @@ -35,14 +35,12 @@ 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 ["app"] 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 install -v`. -This image also includes the `CMD ["app"]` instruction which is the default command -when running the image. - You can then build and run the Docker image: docker build -t my-golang-app . diff --git a/golang/content.md b/golang/content.md index 7e2383ae..2932507e 100644 --- a/golang/content.md +++ b/golang/content.md @@ -19,14 +19,12 @@ 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 ["app"] 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 install -v`. -This image also includes the `CMD ["app"]` instruction which is the default command -when running the image. - You can then build and run the Docker image: docker build -t my-golang-app . From bd44be5fbd7cab1853855bb6ea1ddb163319cdd8 Mon Sep 17 00:00:00 2001 From: pmcgrath Date: Mon, 20 Oct 2014 21:21:40 +0100 Subject: [PATCH 5/6] Revert "Restored the CMD instruction to the Dockerfile and removed the CMD instruction explanation, this is a bit of a simplification but is a simplier explanation for a newbie" This reverts commit 9e53ea71fa9e6f0a71a72530df8bb7c5f17515c2. --- golang/README.md | 4 +++- golang/content.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/golang/README.md b/golang/README.md index b46170d6..6ec0068f 100644 --- a/golang/README.md +++ b/golang/README.md @@ -35,12 +35,14 @@ 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 ["app"] 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 install -v`. +This image also includes the `CMD ["app"]` instruction which is the default command +when running the image. + You can then build and run the Docker image: docker build -t my-golang-app . diff --git a/golang/content.md b/golang/content.md index 2932507e..7e2383ae 100644 --- a/golang/content.md +++ b/golang/content.md @@ -19,12 +19,14 @@ 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 ["app"] 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 install -v`. +This image also includes the `CMD ["app"]` instruction which is the default command +when running the image. + You can then build and run the Docker image: docker build -t my-golang-app . From 186aaa9f7351342063eed7f85497973daf04332f Mon Sep 17 00:00:00 2001 From: pmcgrath Date: Wed, 22 Oct 2014 23:36:52 +0100 Subject: [PATCH 6/6] Added extra qualification regarding when running the image with no arguments --- golang/README.md | 2 +- golang/content.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/golang/README.md b/golang/README.md index 6ec0068f..95bb6572 100644 --- a/golang/README.md +++ b/golang/README.md @@ -41,7 +41,7 @@ applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v`, and `RUN go install -v`. This image also includes the `CMD ["app"]` instruction which is the default command -when running the image. +when running the image without arguments. You can then build and run the Docker image: diff --git a/golang/content.md b/golang/content.md index 7e2383ae..1f99cbbe 100644 --- a/golang/content.md +++ b/golang/content.md @@ -25,7 +25,7 @@ applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v`, and `RUN go install -v`. This image also includes the `CMD ["app"]` instruction which is the default command -when running the image. +when running the image without arguments. You can then build and run the Docker image: