mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
add dockerfile
This commit is contained in:
parent
0ad5c32c46
commit
c042d2f323
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
FROM python:3.6
|
||||
RUN apt update && apt install -y \
|
||||
less \
|
||||
telnet
|
||||
RUN mkdir /source
|
||||
WORKDIR /source
|
||||
ADD ./requirements.txt ./
|
||||
RUN pip install -r requirements.txt
|
||||
COPY . .
|
||||
CMD python mishards/main.py
|
||||
32
build.sh
Executable file
32
build.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
BOLD=`tput bold`
|
||||
NORMAL=`tput sgr0`
|
||||
YELLOW='\033[1;33m'
|
||||
ENDC='\033[0m'
|
||||
|
||||
function build_image() {
|
||||
dockerfile=$1
|
||||
remote_registry=$2
|
||||
tagged=$2
|
||||
buildcmd="docker build -t ${tagged} -f ${dockerfile} ."
|
||||
echo -e "${BOLD}$buildcmd${NORMAL}"
|
||||
$buildcmd
|
||||
pushcmd="docker push ${remote_registry}"
|
||||
echo -e "${BOLD}$pushcmd${NORMAL}"
|
||||
$pushcmd
|
||||
echo -e "${YELLOW}${BOLD}Image: ${remote_registry}${NORMAL}${ENDC}"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
|
||||
all)
|
||||
version=""
|
||||
[[ ! -z $2 ]] && version=":${2}"
|
||||
build_image "Dockerfile" "registry.zilliz.com/milvus/mishards${version}" "registry.zilliz.com/milvus/mishards"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: [option...] {base | apps}"
|
||||
echo "all, Usage: build.sh all [tagname|] => registry.zilliz.com/milvus/mishards:\${tagname}"
|
||||
;;
|
||||
esac
|
||||
Loading…
x
Reference in New Issue
Block a user