Compare commits

...

2 Commits

Author SHA1 Message Date
Stephen McQuay 805db63c76
silence is golden 2018-04-17 12:25:39 -07:00
Stephen McQuay 3fb9fadfb1
implements builder pattern for lim 2018-04-17 12:25:39 -07:00
4 changed files with 35 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build

8
Dockerfile Normal file
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
Dockerfile.build Normal file
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
Makefile Normal file
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 > /dev/null
@docker create --name ext smcquay/lim:build > /dev/null
@docker cp ext:/usr/local/bin/lim build/ > /dev/null
@docker rm -f ext > /dev/null
@docker image rm smcquay/lim:build > /dev/null
build:
@mkdir build
.PHONY: docker-image
docker-image: build/lim
@docker build --no-cache -t smcquay/lim:latest . > /dev/null
.PHONY: clean
clean:
@rm -rf build