diff --git a/install/bundle/Dockerfile b/install/bundle/Dockerfile index cfa24b2..f7e1b82 100644 --- a/install/bundle/Dockerfile +++ b/install/bundle/Dockerfile @@ -1,10 +1,11 @@ FROM ubuntu:18.04 MAINTAINER MascoSkray +ARG CLONE_ADDFLAG #Update apt and install git RUN apt-get update && apt-get install -y git #Clone the latest UOJ Community verison to local -RUN cd ~ && git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 +RUN cd ~ && git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 --single-branch ${CLONE_ADDFLAG} #Install environment and set startup script RUN cd ~/UOJ-System/install/bundle && sh install.sh -p && echo "\ #!/bin/sh\n\ diff --git a/install/bundle/hooks/build b/install/bundle/hooks/build new file mode 100644 index 0000000..63e2605 --- /dev/null +++ b/install/bundle/hooks/build @@ -0,0 +1,6 @@ +#!/bin/sh +CLONE_ADDFLAG="-b $DOCKER_TAG" +if [ "$DOCKER_TAG" = "latest" ]; then + CLONE_ADDFLAG="-b master" +fi +docker build -t $IMAGE_NAME --build-arg CLONE_ADDFLAG="$CLONE_ADDFLAG" .