implements builder pattern for lim
This commit is contained in:
parent
d7eb517c65
commit
3fb9fadfb1
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
build
|
8
Dockerfile
Normal file
8
Dockerfile
Normal 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
7
Dockerfile.build
Normal 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
19
Makefile
Normal 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
|
Loading…
Reference in New Issue
Block a user