加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/modelscope/modelscope
克隆/下载
Makefile.docker 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
DOCKER_REGISTRY = registry.cn-shanghai.aliyuncs.com
DOCKER_ORG = modelscope
DOCKER_IMAGE = modelscope
DOCKER_FULL_NAME = $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE)
# CUDA_VERSION = 11.3
# CUDNN_VERSION = 8
BASE_RUNTIME = reg.docker.alibaba-inc.com/pai-dlc/pytorch-training:1.10PAI-gpu-py36-cu113-ubuntu18.04
# BASE_DEVEL = reg.docker.alibaba-inc.com/pai-dlc/pytorch-training:1.10PAI-gpu-py36-cu113-ubuntu18.04
BASE_DEVEL = pytorch/pytorch:1.10.0-cuda11.3-cudnn8-devel
MODELSCOPE_VERSION = $(shell git describe --tags --always)
# Can be either official / dev
BUILD_TYPE = dev
BUILD_PROGRESS = auto
BUILD_ARGS = --build-arg BASE_IMAGE=$(BASE_IMAGE)
EXTRA_DOCKER_BUILD_FLAGS ?= --network=host
# DOCKER_BUILD = DOCKER_BUILDKIT=1 \
# docker build \
# --progress=$(BUILD_PROGRESS) \
# $(EXTRA_DOCKER_BUILD_FLAGS) \
# --target $(BUILD_TYPE) \
# -t $(DOCKER_FULL_NAME):$(DOCKER_TAG) \
# $(BUILD_ARGS) \
# -f docker/pytorch.dockerfile .
DOCKER_BUILD = DOCKER_BUILDKIT=1 \
docker build \
$(EXTRA_DOCKER_BUILD_FLAGS) \
-t $(DOCKER_FULL_NAME):$(DOCKER_TAG) \
$(BUILD_ARGS) \
-f docker/pytorch.dockerfile .
DOCKER_PUSH = docker push $(DOCKER_FULL_NAME):$(DOCKER_TAG)
.PHONY: all
all: devel-image
.PHONY: devel-image
devel-image: BASE_IMAGE := $(BASE_DEVEL)
devel-image: DOCKER_TAG := $(MODELSCOPE_VERSION)-devel
devel-image:
$(DOCKER_BUILD)
.PHONY: devel-push
devel-push: BASE_IMAGE := $(BASE_DEVEL)
devel-push: DOCKER_TAG := $(MODELSCOPE_VERSION)-devel
devel-push:
$(DOCKER_PUSH)
.PHONY: runtime-image
runtime-image: BASE_IMAGE := $(BASE_RUNTIME)
runtime-image: DOCKER_TAG := $(MODELSCOPE_VERSION)-runtime
runtime-image:
$(DOCKER_BUILD)
docker tag $(DOCKER_FULL_NAME):$(DOCKER_TAG) $(DOCKER_FULL_NAME):latest
.PHONY: runtime-push
runtime-push: BASE_IMAGE := $(BASE_RUNTIME)
runtime-push: DOCKER_TAG := $(MODELSCOPE_VERSION)-runtime
runtime-push:
$(DOCKER_PUSH)
.PHONY: clean
clean:
-docker rmi -f $(shell docker images -q $(DOCKER_FULL_NAME))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化