This repository has been archived by the owner on Mar 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
48 lines (41 loc) · 1.82 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
IMAGE_NAME := jamesantill/flat-modules-dnf
SYSTEMD_CONTAINER_NAME := boltron
DOCKER_FNAME := Dockerfile
# DOCKER_FNAME := Dockerfile-with-local-dnf
help:
@echo "make build - Build a new docker image."
@echo "make update - Build a new docker image, updating baseruntime."
@echo "make update-force - Build a new docker image, from scratch."
@echo "make run - Run the new image with bash."
@echo "make push-james - Push the new build to jamesantill/flat-modules-dnf."
@echo "make run-systemd - Enables systemd in the container, relies on atomic-cli." \
"You may need 'setsebool -P container_manage_cgroup 1' in order to make systemd work"
@echo "make old-run-systemd - Enables systemd in the container." \
"You may need 'setsebool -P container_manage_cgroup 1' in order to make systemd work"
build:
@docker build --file=$(DOCKER_FNAME) . -t $(IMAGE_NAME)
run:
@docker run --rm -it $(IMAGE_NAME) bash
push-james:
@docker push $(IMAGE_NAME)
update:
@docker build --file=$(DOCKER_FNAME) --pull . -t $(IMAGE_NAME)
update-force:
@docker build --file=$(DOCKER_FNAME) --pull --no-cache . -t $(IMAGE_NAME)
run-systemd:
docker start $(SYSTEMD_CONTAINER_NAME) || \
atomic run -n $(SYSTEMD_CONTAINER_NAME) $(IMAGE_NAME)
@echo -e "\nContainer '$(SYSTEMD_CONTAINER_NAME)' with systemd is running.\n"
docker exec -ti $(SYSTEMD_CONTAINER_NAME) bash
old-run-systemd:
docker start $(SYSTEMD_CONTAINER_NAME) || \
docker run -e container=docker -d \
-v $(CURDIR)/machine-id:/etc/machine-id:Z \
--stop-signal="SIGRTMIN+3" \
--tmpfs /tmp --tmpfs /run \
--security-opt=seccomp:unconfined \
-v /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd \
--name $(SYSTEMD_CONTAINER_NAME) \
$(IMAGE_NAME) /sbin/init
@echo -e "\nContainer '$(SYSTEMD_CONTAINER_NAME)' with systemd is running.\n"
docker exec -ti $(SYSTEMD_CONTAINER_NAME) bash