mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-23 00:38:42 +00:00
e0914a8f31
Previous the branch in Dockerfile is specified manually in each branch. But when someone want to change the branch or test they must modify it. To make the process more intelligent, we will auto get the branch name. And, to make the image smaller, we added --single-branch argument onto.
7 lines
185 B
Bash
7 lines
185 B
Bash
#!/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" .
|