Browse Source

dockerize image

master
dave 1 year ago
parent
commit
092ee0218f
3 changed files with 41 additions and 0 deletions
  1. +17
    -0
      Dockerfile
  2. +17
    -0
      Makefile
  3. +7
    -0
      start

+ 17
- 0
Dockerfile 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
- 0
Makefile 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
- 0
start 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

Loading…
Cancel
Save