Matthew Faltys
7 years ago
6 changed files with 53 additions and 1 deletions
@ -0,0 +1,32 @@ |
|||||||
|
GOC=go build
|
||||||
|
GOFLAGS=-a -ldflags '-s'
|
||||||
|
CGOR=CGO_ENABLED=0
|
||||||
|
IMAGE_NAME=smpldbot
|
||||||
|
|
||||||
|
all: lorebot |
||||||
|
|
||||||
|
lorebot: |
||||||
|
$(GOC) lorebot/lorebot.go
|
||||||
|
|
||||||
|
run: |
||||||
|
go run lorebot/lorebot.go
|
||||||
|
|
||||||
|
stat: |
||||||
|
mkdir -p bin/
|
||||||
|
$(CGOR) $(GOC) -o bin/lorebot $(GOFLAGS) lorebot/*.go
|
||||||
|
|
||||||
|
docker: stat |
||||||
|
mkdir stage.tmp/
|
||||||
|
cp bin/lorebot stage.tmp/
|
||||||
|
cp deps/rootfs.tar.gz stage.tmp/
|
||||||
|
cp deps/Dockerfile stage.tmp/
|
||||||
|
chmod +x deps/run.sh
|
||||||
|
cp deps/run.sh stage.tmp/
|
||||||
|
cp config.gcfg stage.tmp/
|
||||||
|
cd stage.tmp/ && \
|
||||||
|
sudo docker build -t $(IMAGE_NAME) .
|
||||||
|
@echo "$(IMAGE_NAME) built"
|
||||||
|
|
||||||
|
clean: |
||||||
|
rm -rf bin/
|
||||||
|
rm -rf stage.tmp/
|
@ -0,0 +1,8 @@ |
|||||||
|
FROM scratch |
||||||
|
|
||||||
|
ADD rootfs.tar.gz / |
||||||
|
COPY config.gcfg / |
||||||
|
COPY lorebot / |
||||||
|
COPY run.sh / |
||||||
|
|
||||||
|
CMD ["/run.sh"] |
Binary file not shown.
Loading…
Reference in new issue