-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (42 loc) · 1.27 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
# Definitions Makefile
# Build an image using Dockerfile
docs-build:
# --tag=""
# Repository names (and optionally with tags) to be applied to the resulting
# image in case of success. Refer to docker-tag(1) for more information
# about valid tag names.
docker build --tag $(image) .
# Create the container
docs-create:
# --name string Assign a name to the container
# --publish list Publish a container's port(s) to the host
# --restart string Restart policy to apply when a container exits (docs "no")
# --restart unless-stopped
# Always restart the container regardless of the exit status, but
# do not start it on daemon startup if the container has been put to a
# stopped state before.
docker create --name $(container) --publish $(port_map) \
--restart unless-stopped \
$(image)
# Remove the container
docs-rm:
docker rm $(container)
# Start the container
docs-start:
docker start $(container)
# Stop the container
docs-stop:
docker stop $(container)
# Save the image to a file
docs-save:
docker save $(image) -o $(tarfile)
# Load the image from a file
docs-load:
docker load -i $(tarfile)
# Show container logs
docs-logs:
# -f, --follow[=false] Follow log output
docker logs --follow $(container)
# Pull the image
docs-pull:
docker pull $(image)