- build automatico con tag versione

- docker-compose per ambiente di test
This commit is contained in:
Michele 2018-10-23 09:26:55 +02:00
parent a78109af0d
commit e1f9da40e4
6 changed files with 49 additions and 3 deletions

View file

@ -3,6 +3,9 @@ FROM scratch
MAINTAINER Michele Fadda "<mikif70@gmail.com>"
COPY lastlogin_mongodb-v4.4.1b /bin/lastlogin_mongodb
ARG VER
ENV VER ${VER:-0.0.0}
COPY lastlogin_mongodb-${VER} /bin/lastlogin_mongodb
ENTRYPOINT [ "/bin/lastlogin_mongodb" ]

View file

@ -1,3 +1,3 @@
#!/bin/bash
docker build -t mikif70/llmongo:4.4.1b .
docker build -t mikif70/llmongo:$(git -C .. describe --tags) -t repo.ism.tiscali.sys:5000/mikif70/llmongo:$(git -C .. describe --tags) --build-arg VER=$(git -C .. describe --tags) .

View file

@ -1,3 +1,5 @@
#!/bin/bash
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo .
CGO_ENABLED=0 GOOS=linux go build -o lastlogin_mongodb-$(git describe --tags) -a -installsuffix cgo .
mv lastlogin_mongodb-$(git describe --tags) Docker/

View file

@ -0,0 +1,18 @@
version: '2'
services:
mongodb:
image: mikif70/mongodb:3.4.7
ports:
- 27017:27017
container_name: ll_mongod
volumes:
- ./mongod:/data
depends_on:
- redis
redis:
image: "redis:alpine"
container_name: ll_redis
ports:
- 6379:6379
volumes:
- ./redis:/data

9
docker-compose/mongo.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
if [ -z $1 ]; then
HOST=192.168.0.1:27017
else
HOST=${1}
fi
docker run --rm -it mikif70/mongotools:3.4.7 mongo ${HOST}

14
docker-compose/test.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
docker run \
--rm \
-v /opt/WORK/PROJECTS/New_Mail/lastlogin_mongodb/docker-compose/llmongo:/data \
--name llmongo \
mikif70/llmongo:4.4.0 \
-l /data/llmongo.log \
-r 192.168.0.1:6379 \
-m 192.168.0.1:27017 \
-d lastlogin \
-T 80s \
-D \
$@