-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
37 lines (30 loc) · 1.58 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
MYSQL_VERSION = 8.0.33
POSTGRESQL_VERSION = 15.3
MONGODB_VERSION = 100.4.0
all: mysql-$(MYSQL_VERSION)-layer.zip mariadb-layer.zip postgresql-$(POSTGRESQL_VERSION)-layer.zip mongodb-tools-$(MONGODB_VERSION)-layer.zip
mysql: mysql-$(MYSQL_VERSION)-layer.zip
mariadb: mariadb-layer.zip
postgresql: postgresql-$(POSTGRESQL_VERSION)-layer.zip
mongodb: mongodb-tools-$(MONGODB_VERSION)-layer.zip
mysql-$(MYSQL_VERSION)-layer.zip:
docker build -f Dockerfile.mysql . -t mysql-layer --build-arg VERSION=$(MYSQL_VERSION)
container_id=$$(docker container create mysql-layer) && \
docker container cp $$container_id:/root/mysql-$(MYSQL_VERSION)-layer.zip . && \
docker container rm $$container_id
mariadb-layer.zip:
docker build -f Dockerfile.mariadb . -t mariadb-layer
container_id=$$(docker container create mariadb-layer) && \
docker container cp $$container_id:/root/mariadb-layer.zip . && \
docker container rm $$container_id
postgresql-$(POSTGRESQL_VERSION)-layer.zip:
docker build -f Dockerfile.postgresql . -t postgresql-layer --build-arg VERSION=$(POSTGRESQL_VERSION)
container_id=$$(docker container create postgresql-layer) && \
docker container cp $$container_id:/root/postgresql-$(POSTGRESQL_VERSION)-layer.zip . && \
docker container rm $$container_id
mongodb-tools-$(MONGODB_VERSION)-layer.zip:
docker build -f Dockerfile.mongodb . -t mongodb-layer --build-arg VERSION=$(MONGODB_VERSION)
container_id=$$(docker container create mongodb-layer) && \
docker container cp $$container_id:/root/mongodb-tools-$(MONGODB_VERSION)-layer.zip . && \
docker container rm $$container_id
clean:
rm -f *.zip