-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
52 lines (45 loc) · 1.37 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PACKAGE_VERSION = $(shell cat VERSION)
DOCKER_REPO := hailstorm-db
.PHONY: package
package:
docker build \
--rm \
--label org.opencontainers.image.created=$(shell date -u "+%Y-%m-%dT%H:%M:%S%z") \
--label org.opencontainers.image.revision=$${TRAVIS_COMMIT} \
--label org.opencontainers.image.licenses=MIT \
--label org.opencontainers.image.title="Hailstorm Database" \
--label org.opencontainers.image.description="MySQL database with Hailstorm db users" \
-t $${DOCKER_ID}/${DOCKER_REPO}:${PACKAGE_VERSION} .
publish:
set -ev
docker tag $${DOCKER_ID}/${DOCKER_REPO}:${PACKAGE_VERSION} $${DOCKER_ID}/${DOCKER_REPO}:latest
@docker login --username $${DOCKER_ID} -p $${DOCKER_PASSWORD}
docker push $${DOCKER_ID}/${DOCKER_REPO}:${PACKAGE_VERSION}
docker push $${DOCKER_ID}/${DOCKER_REPO}:latest
run_local:
docker run \
--rm \
-p 3306:3306 \
-e MYSQL_RANDOM_ROOT_PASSWORD=true \
--name hailstorm-db \
-d \
hailstorm3/${DOCKER_REPO}:${PACKAGE_VERSION}
run:
docker run \
--rm \
-p 3306:3306 \
-e MYSQL_RANDOM_ROOT_PASSWORD=true \
--network ${NETWORK} \
--name hailstorm-db \
-d \
hailstorm3/${DOCKER_REPO}:${PACKAGE_VERSION}
stop:
docker stop hailstorm-db
mysql_client:
docker run \
-it \
--rm \
--name hailstorm-db-client \
--network ${NETWORK} \
hailstorm3/${DOCKER_REPO}:${PACKAGE_VERSION} \
mysql -h hailstorm-db -u ${DB_USER} -p