加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Makefile 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
Joel Emer 提交于 2021-03-16 09:05 . Add ALTIMG flags to Makefile
#
# Utility Makefile to build/push Docker images
#
# To use an alternate tag invoke as:
#
# make build ALTTAG=<alternate-tag>
#
# Optionally override
#
# DOCKER_EXE=<name of docker executable>
# DOCKER_NAME=<name of user where image will be pushed>
#
# Set this envirnment or command line variable
#
# DOCKER_PASS=<password of uesr where image will be pushed>
#
DOCKER_EXE ?= docker
DOCKER_NAME ?= mitdlh
VERSION := 0.1
USER := mitdlh
REPO := timeloop-accelergy-pytorch
NAME := ${USER}/${REPO}
TAG := $$(git log -1 --pretty=%h)
IMG := ${NAME}:${TAG}
ALTTAG := latest
ALTIMG := ${NAME}:${ALTTAG}
all: build
# Pull all submodules
pull:
git submodule foreach git pull origin master
# Build and tag docker image
build:
"${DOCKER_EXE}" build ${BUILD_FLAGS} \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=${TAG} \
--build-arg BUILD_VERSION=${VERSION} \
-t ${IMG} .
"${DOCKER_EXE}" tag ${IMG} ${ALTIMG}
# Push docker image
push:
@echo "Pushing ${NAME}"
"${DOCKER_EXE}" push ${NAME}
# Lint the Dockerfile
lint:
"${DOCKER_EXE}" run --rm -i hadolint/hadolint < Dockerfile || true
# Login to docker hub
login:
"${DOCKER_EXE}" login --username ${DOCKER_NAME} --password ${DOCKER_PASS}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化