-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
51 lines (33 loc) · 1.28 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
PREFIX ?= $(CURDIR)/build/bin/
CMD=nix-snapshotter
.PHONY: all build nix-snapshotter nix2container start-containerd start-nix-snapshotter run-hello run-redis clean
all: build
build: $(CMD)
FORCE:
nix-snapshotter: FORCE
go build -o $(PREFIX) .
nix2container: FORCE
go build -o $(PREFIX) ./cmd/nix2container
build/containerd/config.toml:
bash ./script/rootless/create-containerd-config.sh
build/nerdctl/nerdctl.toml:
bash ./script/rootless/create-nerdctl-config.sh
build/nerdctl/nix-snapshotter.toml:
bash ./script/rootless/create-nix-snapshotter-config.sh
start-containerd: build/containerd/config.toml
bash ./script/rootless/containerd.sh
start-nix-snapshotter: nix-snapshotter build/nerdctl/nix-snapshotter.toml
bash ./script/rootless/nix-snapshotter.sh
load-hello: nix2container
bash ./script/rootless/load-image.sh hello
load-redis: nix2container
bash ./script/rootless/load-image.sh redis
run-hello: build/nerdctl/nerdctl.toml load-hello
bash ./script/rootless/nerdctl.sh run --rm ghcr.io/pdtpartners/hello
run-redis: build/nerdctl/nerdctl.toml load-redis
bash ./script/rootless/nerdctl.sh run --rm -p 6379:6379 ghcr.io/pdtpartners/redis --protected-mode no
# e.g. `make nsenter ARGS="nerdctl --help"`
nsenter:
bash ./script/rootless/nsenter.sh $(ARGS)
clean:
rm -rf ./build