WORKSPACE := /root/rocker

build:
	cargo build --release

# 创建WORKSPACE 对应的文件夹
install: build
	mkdir -p $(WORKSPACE)
	mkdir -p $(WORKSPACE)/images
	mkdir -p $(WORKSPACE)/volumes
	mkdir -p $(WORKSPACE)/containers
	chmod -R 777 $(WORKSPACE)

	cp images/* /root/rocker/images/
	cp target/release/rocker /usr/bin/rocker

	# 创建一个普通用户
	-useradd -g rocker rocker
	-groupadd rocker

clean:
	rm -rf $(WORKSPACE)
	rm -rf /usr/bin/rocker
