From b31eb284f028fea2fb505b060fc38b1f7a3dc0ce Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 18 Sep 2018 11:21:11 -0700 Subject: [PATCH] Rebase Dockerfile on golang:1.10 --- Dockerfile | 14 +++++--------- Makefile | 2 +- README.md | 7 +++++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index db58c95..ca5e224 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,17 +16,13 @@ # # # later... # docker start blog -FROM fedora:latest - -RUN dnf -y update -RUN dnf -y install golang make +FROM golang:1.10 WORKDIR /go/src/github.com/kirsle/blog -ADD . /go/src/github.com/kirsle/blog +COPY . . -ENV GOPATH /go -RUN go get ./... -RUN make build +RUN go get -d -v ./... +RUN go install -v ./... EXPOSE 80 -CMD ["/go/src/github.com/kirsle/blog/bin/blog", "-a", ":80", "/data/www"] +CMD ["blog", "-a", ":80", "/data/www"] diff --git a/Makefile b/Makefile index 2af9e36..b7e015c 100644 --- a/Makefile +++ b/Makefile @@ -47,4 +47,4 @@ docker.build: # `make docker.run` to run the docker image .PHONY: docker.run docker.run: - docker run --rm --name blog_debug -p 8000:80 -v $(CURDIR)/user-root:/data/www blog + docker run --rm --name blog_debug -p 8000:80 -v "$(CURDIR)/user-root:/data/www:z" blog diff --git a/README.md b/README.md index df1601d..32cdf0e 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,13 @@ make run This app includes a Dockerfile. Type `make docker.build` to build the Docker image. +The Docker container uses the user document root at `/data/www` + +```bash +docker build -t blog . +docker run --rm --name blog_debug -p 8000:80 -v $(CURDIR)/user-root:/data/www blog +``` + ### Quick Start ```bash