Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
04e200eb54 | |||
805db63c76 | |||
3fb9fadfb1 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
build
|
13
Dockerfile
Normal file
13
Dockerfile
Normal 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
20
Makefile
Normal 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
|
Loading…
Reference in New Issue
Block a user