chore: try to pull first then build
This commit is contained in:
parent
ff98b7b05f
commit
d6c22318b3
2
.github/workflows/container.yml
vendored
2
.github/workflows/container.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
path: |
|
||||
~/.local/share/containers
|
||||
~/.config/containers
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/*.Dockerfile', 'build_image.sh', 'VERSION', 'go.*') }}
|
||||
key: ${{ runner.os }}
|
||||
- name: Login to Container Registry
|
||||
uses: redhat-actions/podman-login@v1
|
||||
with:
|
||||
|
@ -9,6 +9,12 @@ log_info "VERSION: $VERSION"
|
||||
# Image Prefix
|
||||
IMAGE_PREFIX=${IMAGE_PREFIX:-"git.0x7f.app/woj"}
|
||||
|
||||
function docker_pull() {
|
||||
tag_name="$IMAGE_PREFIX/$1:$VERSION"
|
||||
shift 1
|
||||
$DOCKER pull "$tag_name" "$@" || log_warn "[!] Failed to pull $tag_name"
|
||||
}
|
||||
|
||||
function docker_build() {
|
||||
tag_name="$IMAGE_PREFIX/$1:$VERSION"
|
||||
docker_file="$2"
|
||||
@ -26,6 +32,8 @@ function docker_push() {
|
||||
function build_rootfs() {
|
||||
log_info "[+] Building Rootfs Images"
|
||||
pushd resource/runner || exit 1
|
||||
docker_pull "debian-full"
|
||||
docker_pull "debian-run"
|
||||
docker_build "debian-full" "scripts/debian-full.Dockerfile"
|
||||
docker_build "debian-run" "scripts/debian-run.Dockerfile"
|
||||
popd || exit 1
|
||||
@ -39,16 +47,19 @@ function push_rootfs() {
|
||||
|
||||
function build_base() {
|
||||
log_info "[+] Building Base"
|
||||
docker_pull "woj-server-base"
|
||||
docker_build "woj-server-base" "Base.Dockerfile"
|
||||
}
|
||||
|
||||
function build_server() {
|
||||
log_info "[+] Building Server"
|
||||
docker_pull "woj-server"
|
||||
docker_build "woj-server" "Server.Dockerfile"
|
||||
}
|
||||
|
||||
function build_runner() {
|
||||
log_info "[+] Building Runner"
|
||||
docker_pull "woj-runner"
|
||||
docker_build "woj-runner" "Runner.Dockerfile"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user