dockerize image

This commit is contained in:
dave 2019-03-06 18:43:52 -08:00
parent d7b8e82b5c
commit 092ee0218f
3 changed files with 41 additions and 0 deletions

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM golang:1.14
ADD . /tmp/code
RUN cd /tmp/code && make
FROM ubuntu:eoan
COPY --from=0 /tmp/code/redis-sentinel-proxy /usr/local/bin/redis-sentinel-proxy
ADD start /start
RUN chmod +x /start
USER nobody
ENTRYPOINT ["/start"]

17
Makefile Normal file
View File

@ -0,0 +1,17 @@
TAGNAME := dockermirror:5000/dpedu/redisproxy
LOCALNAME := redisproxy
.DEFAULT_GOAL: redis-sentinel-proxy
redis-sentinel-proxy:
go build -o $@
image:
rm -f redis-sentinel-proxy
docker build -t $(LOCALNAME) .
tag: image
docker tag $(LOCALNAME) $(TAGNAME)
push: tag
docker push $(TAGNAME)

7
start Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh -ex
LOCALPORT=${LOCALPORT:-:9999}
SENTINEL=${SENTINEL:-:26739}
MASTERNAME=${MASTERNAME:-""}
exec /usr/local/bin/redis-sentinel-proxy -listen $LOCALPORT -sentinel $SENTINEL -master $MASTERNAME