Welcome to mirror list, hosted at ThFree Co, Russian Federation.

docker-build.sh - github.com/openwrt/docker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 20f09e3a1f94ad240b5949ab1d491dc102104e4e (plain)
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
32
33
#!/bin/bash

set -ex

DOCKERFILE="${DOCKERFILE:-Dockerfile}"
# Copy Dockerfile inside build context to support older Docker versions
# See https://github.com/docker/cli/pull/886
cp "$DOCKERFILE" ./build/
docker build -t "$DOCKER_IMAGE:$TARGET-$VERSION" -f "./build/$DOCKERFILE" ./build

if [ -n "$ARCH" ]; then
    docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" "$DOCKER_IMAGE:$ARCH-$VERSION"
fi

if [ "$VERSION" == "snapshot" ]; then
    docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" "$DOCKER_IMAGE:$TARGET-$BRANCH"

    if [ -n "$ARCH" ]; then
        docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" "$DOCKER_IMAGE:$ARCH"
    fi
    docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" "$DOCKER_IMAGE:$TARGET"

    if [ "$TARGET" == "x86-64" ]; then
        docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" "$DOCKER_IMAGE:$BRANCH"
        docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" "$DOCKER_IMAGE:latest"
    fi
fi

if [ "$TARGET" == "x86-64" ]; then
    docker tag "$DOCKER_IMAGE:$TARGET-$VERSION" "$DOCKER_IMAGE:$VERSION"
fi

rm -rf ./build