Compare commits

..

3 Commits
master ... dms

3 changed files with 34 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM golang:1.10.1 as build
WORKDIR /go/src/mcquay.me/lim
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /usr/local/bin/lim .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /
COPY --from=build /usr/local/bin/lim /bin/
CMD ["/bin/sh", "-c", "cat /dev/urandom | /bin/lim 16b | xxd"]

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
GOFILES := $(shell find . -type f | grep go$$ )
build/lim: build build/.docker-image ${GOFILES}
@echo "fetching binary from image"
@docker create --name ext smcquay/lim:latest > /dev/null
@docker cp ext:/bin/lim build/ > /dev/null
@docker rm -f ext > /dev/null
@touch build/lim
build/.docker-image: ${GOFILES}
@echo "building docker image"
@docker build --no-cache -t smcquay/lim:latest . > /dev/null
@touch build/.docker-image
build:
@mkdir build
.PHONY: clean
clean:
@rm -rf build