-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (49 loc) · 1.13 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
SHELL := /bin/bash
CURRENT_OS := $(shell uname -s)
ifeq ($(CURRENT_OS), Linux)
CURRENT_OS := $(shell lsb_release -si)
endif
ifeq ($(CURRENT_OS), Darwin)
PATH := /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
SHELL := env PATH=$(PATH) /bin/bash
endif
TAG='rodfersou/asdf'
NAME='rodfersou_asdf'
all: start
build:
make clean
docker buildx build -t $(TAG) .
start:
docker run --rm -it $(TAG) bash
restart:
make stop
make start
stop:
-docker container stop $(NAME)
stop-all:
-docker stop $$(docker ps -aq)
-docker rm $$(docker ps -aq)
export:
-rm $(NAME)_$(CURRENT_OS).tar.gz
docker save $(TAG) | gzip > $(NAME)_$(CURRENT_OS).tar.gz
du -sh $(NAME)_$(CURRENT_OS).tar.gz
import:
make clean
docker load < $(NAME)_$(CURRENT_OS).tar.gz
clean:
make stop
-docker image rm $(TAG)
clean-cache-nix:
-docker volume rm cache nix
clean-srv:
-docker volume rm srv
clean-all:
-docker stop $$(docker ps -aq)
-docker rm $$(docker ps -aq)
-docker rmi $$(docker images -q)
# -docker volume rm $$(docker volume ls -q)
rebuild:
make clean-all
make build
make export
.PHONY: all clean