1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-14 10:17:26 +08:00

Add docker files

This commit is contained in:
Jonathan Leibiusky (@xetorthio) 2016-11-10 15:30:40 -03:00
parent 8e4981d24f
commit 39f3da3a82
3 changed files with 33 additions and 0 deletions

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM golang:1.7.1
# Copy the runtime dockerfile into the context as Dockerfile
COPY Dockerfile.run /go/bin/Dockerfile
COPY ./www /go/bin/www
COPY . /go/src/github.com/franela/play-with-docker
WORKDIR /go/src/github.com/franela/play-with-docker
RUN go get -v -d ./...
RUN CGO_ENABLED=0 go build -a -installsuffix nocgo -o /go/bin/play-with-docker .
# Set the workdir to be /go/bin which is where the binaries are built
WORKDIR /go/bin
# Export the WORKDIR as a tar stream
CMD tar -cf - .

11
Dockerfile.run Normal file
View File

@ -0,0 +1,11 @@
FROM alpine
RUN apk --update add ca-certificates
ADD play-with-docker /bin/play-with-docker
COPY ./www /bin/www
WORKDIR /bin
CMD ["play-with-docker"]
EXPOSE 3000

3
build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker build -t builder .&& docker run --rm builder | sudo docker build -t franela/play-with-docker:master -