implements builder pattern for lim

This commit is contained in:
sm
2018-04-17 12:25:39 -07:00
parent d7eb517c65
commit 3fb9fadfb1
4 changed files with 35 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
build
+8
View File
@@ -0,0 +1,8 @@
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /
COPY build/lim /bin/
CMD ["/bin/sh", "-c", "cat /dev/urandom | /bin/lim 16b | xxd"]
+7
View File
@@ -0,0 +1,7 @@
FROM golang:1.10.1
WORKDIR /go/src/mcquay.me/lim
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /usr/local/bin/lim .
+19
View File
@@ -0,0 +1,19 @@
GOFILES := $(shell find . -type f | grep go$$ )
build/lim: build ${GOFILES}
docker build -t smcquay/lim:build . -f Dockerfile.build
docker create --name ext smcquay/lim:build
docker cp ext:/usr/local/bin/lim build/
docker rm -f ext
docker image rm smcquay/lim:build
build:
@mkdir build
.PHONY: docker-image
docker-image: build/lim
docker build --no-cache -t smcquay/lim:latest .
.PHONY: clean
clean:
@rm -rf build