-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·31 lines (25 loc) · 1.04 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# required if the docker image needs to be created and cannot just use sfucsssorg/wall_e
if [ -z "${WALL_E_PYTHON_BASE_IMAGE}" ]; then
echo "WALL_E_PYTHON_BASE_IMAGE is not set"
exit 1
fi
if [ -z "${DOCKER_HUB_PASSWORD}" ]; then
echo "DOCKER_HUB_PASSWORD is not set"
exit 1
fi
if [ -z "${DOCKER_HUB_USER_NAME}" ]; then
echo "DOCKER_HUB_USER_NAME is not set"
exit 1
fi
export wall_e_bottom_base_image_dockerfile="Dockerfile"
docker image rm -f "${WALL_E_PYTHON_BASE_IMAGE}" || true
docker system prune -f --all
docker build --no-cache -t ${WALL_E_PYTHON_BASE_IMAGE} -f ${wall_e_bottom_base_image_dockerfile} .
export WALL_E_BASE_ORIGIN_NAME="${WALL_E_PYTHON_BASE_IMAGE}"
docker tag ${WALL_E_PYTHON_BASE_IMAGE} sfucsssorg/${WALL_E_PYTHON_BASE_IMAGE}
echo "${DOCKER_HUB_PASSWORD}" | docker login --username=${DOCKER_HUB_USER_NAME} --password-stdin
docker push sfucsssorg/${WALL_E_PYTHON_BASE_IMAGE}
docker rmi sfucsssorg/${WALL_E_PYTHON_BASE_IMAGE}
docker image rm "${WALL_E_PYTHON_BASE_IMAGE}"
docker system prune -f --all