dockerize

This commit is contained in:
Matt Drollette
2015-01-26 17:59:48 -06:00
parent 73dddf7776
commit e162f485b5
4 changed files with 44 additions and 0 deletions

2
.gitignore vendored
View File

@@ -6,3 +6,5 @@ i2pseeds.su3
reseed_cert.pem
reseed_private.pem
/build
/.build
/release/i2p-tools

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM golang
# Copy the local package files to the container's workspace.
ADD . /go/src/github.com/MDrollette/i2p-tools
# Make project CWD
WORKDIR /go/src/github.com/MDrollette/i2p-tools
# Build everything
RUN go get
RUN go build -o /i2p-tools
CMD ["/i2p-tools"]

22
Makefile Normal file
View File

@@ -0,0 +1,22 @@
NAME = i2p-tools
DOCKER_IMAGE = mdrollette/$(NAME)
all: build
.build: .
docker build -t $(NAME) .
docker inspect -f '{{.Id}}' $(NAME) > .build
build: .build
release: build
cd release && docker run --rm --entrypoint /bin/sh $(NAME) -c 'tar cf - /$(NAME)' | tar xf -
docker build --rm -t $(DOCKER_IMAGE) release
push: release
docker push $(DOCKER_IMAGE)
clean:
rm -f .build release/i2p-tools
.PHONY: push release build all clean

7
release/Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM progrium/busybox
ADD i2p-tools i2p-tools
ENTRYPOINT ["/i2p-tools"]
EXPOSE 443