-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (25 loc) · 1.05 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
# DOCKER TASKS
# Build the container
# Import docker repo (docker hub creds)
include ./secrets/docker-creds.secrets
DOCKER_IMAGE_NAME = loadtestv1
DOCKER_IMAGE_VERSION = 1.0
# Import docker repo (docker hub creds)
.PHONY: build tag_latest push push_latest last_built_date shell
build: Dockerfile
docker build -t $(DOCKER_REPO_USER)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION) --rm .
tag_latest:
docker tag $(DOCKER_REPO_USER)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION) $(DOCKER_REPO_USER)/$(DOCKER_IMAGE_NAME):latest
push:
docker login -u $(DOCKER_REPO_USER) -p $(DOCKER_REPO_PASS)
docker push $(DOCKER_REPO_USER)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION)
docker logout
push_latest:
docker login -u $(DOCKER_REPO_USER) -p $(DOCKER_REPO_PASS)
docker push $(DOCKER_REPO_USER)/$(DOCKER_IMAGE_NAME):latest
docker logout
last_built_date:
docker inspect -f '{{ .Created }}' $(DOCKER_REPO_USER)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION)
shell:
docker run --rm -i -t $(DOCKER_REPO_USER)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION) /bin/bash
default: build