mirror of
https://github.com/craigerl/aprsd.git
synced 2025-07-09 04:15:17 -04:00
Update Dockerfile and build.sh
This fixes a problem with the github workflow
This commit is contained in:
parent
5891c71483
commit
c1db238719
2
.github/workflows/release_build.yml
vendored
2
.github/workflows/release_build.yml
vendored
@ -41,7 +41,7 @@ jobs:
|
|||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
build-args: |
|
build-args: |
|
||||||
APRSD_VERSION=${{ inputs.aprsd_version }}
|
VERSION=${{ inputs.aprsd_version }}
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
hemna6969/aprsd:v${{ inputs.aprsd_version }}
|
hemna6969/aprsd:v${{ inputs.aprsd_version }}
|
||||||
|
@ -6,7 +6,7 @@ FROM ubuntu:focal as aprsd
|
|||||||
ARG UID
|
ARG UID
|
||||||
ARG GID
|
ARG GID
|
||||||
ARG TZ
|
ARG TZ
|
||||||
ARG APRSD_VERSION=2.5.9
|
ARG VERSION=2.6.0
|
||||||
ENV APRS_USER=aprs
|
ENV APRS_USER=aprs
|
||||||
ENV HOME=/home/aprs
|
ENV HOME=/home/aprs
|
||||||
ENV TZ=${TZ:-US/Eastern}
|
ENV TZ=${TZ:-US/Eastern}
|
||||||
@ -14,7 +14,7 @@ ENV UID=${UID:-1000}
|
|||||||
ENV GID=${GID:-1000}
|
ENV GID=${GID:-1000}
|
||||||
ENV LC_ALL=C.UTF-8
|
ENV LC_ALL=C.UTF-8
|
||||||
ENV LANG=C.UTF-8
|
ENV LANG=C.UTF-8
|
||||||
ENV APRSD_PIP_VERSION=${APRSD_VERSION}
|
ENV APRSD_PIP_VERSION=${VERSION}
|
||||||
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
@ -15,16 +15,19 @@ OPTIONS:
|
|||||||
-t The tag/version (${TAG}) (default = master)
|
-t The tag/version (${TAG}) (default = master)
|
||||||
-d Use Dockerfile-dev for a git clone build
|
-d Use Dockerfile-dev for a git clone build
|
||||||
-b Branch to use (default = master)
|
-b Branch to use (default = master)
|
||||||
|
-r Destroy and rebuild the buildx environment
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ALL_PLATFORMS=0
|
ALL_PLATFORMS=0
|
||||||
DEV=0
|
DEV=0
|
||||||
|
REBUILD_BUILDX=0
|
||||||
TAG="latest"
|
TAG="latest"
|
||||||
BRANCH=${BRANCH:-master}
|
BRANCH=${BRANCH:-master}
|
||||||
|
VERSION="2.6.0"
|
||||||
|
|
||||||
while getopts “hdat:b:” OPTION
|
while getopts “hdart:b:v:” OPTION
|
||||||
do
|
do
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
t)
|
t)
|
||||||
@ -36,9 +39,15 @@ do
|
|||||||
a)
|
a)
|
||||||
ALL_PLATFORMS=1
|
ALL_PLATFORMS=1
|
||||||
;;
|
;;
|
||||||
|
r)
|
||||||
|
REBUILD_BUILDX=1
|
||||||
|
;;
|
||||||
d)
|
d)
|
||||||
DEV=1
|
DEV=1
|
||||||
;;
|
;;
|
||||||
|
v)
|
||||||
|
VERSION=$OPTARG
|
||||||
|
;;
|
||||||
h)
|
h)
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
@ -50,25 +59,28 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
VERSION="2.5.8"
|
|
||||||
|
|
||||||
if [ $ALL_PLATFORMS -eq 1 ]
|
if [ $ALL_PLATFORMS -eq 1 ]
|
||||||
then
|
then
|
||||||
PLATFORMS="linux/arm/v7,linux/arm64,linux/amd64"
|
PLATFORMS="linux/arm/v7,linux/arm64,linux/amd64"
|
||||||
#PLATFORMS="linux/arm/v7,linux/arm/v6,linux/amd64"
|
#PLATFORMS="linux/arm/v7,linux/arm/v6,linux/amd64"
|
||||||
else
|
else
|
||||||
PLATFORMS="linux/amd64,linux/arm/v7"
|
PLATFORMS="linux/amd64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Build with tag=${TAG} BRANCH=${BRANCH} dev?=${DEV} platforms?=${PLATFORMS}"
|
|
||||||
|
|
||||||
|
|
||||||
echo "Destroying old multiarch build container"
|
if [ $REBUILD_BUILDX -eq 1 ]
|
||||||
docker buildx rm multiarch
|
then
|
||||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
echo "Destroying old multiarch build container"
|
||||||
echo "Creating new buildx container"
|
docker buildx rm multiarch
|
||||||
docker buildx create --name multiarch --driver docker-container --use --platform linux/arm/v7,linux/arm/v6,linux/arm64,linux/amd64 --config ./buildkit.toml --use --driver-opt image=moby/buildkit:master
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
docker buildx inspect --bootstrap
|
echo "Creating new buildx container"
|
||||||
|
docker buildx create --name multiarch --driver docker-container --use \
|
||||||
|
--config ./buildkit.toml --use \
|
||||||
|
--driver-opt image=moby/buildkit:master
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $DEV -eq 1 ]
|
if [ $DEV -eq 1 ]
|
||||||
then
|
then
|
||||||
@ -79,14 +91,11 @@ then
|
|||||||
-f Dockerfile-dev --build-arg branch=$BRANCH --no-cache .
|
-f Dockerfile-dev --build-arg branch=$BRANCH --no-cache .
|
||||||
else
|
else
|
||||||
# Use this script to locally build the docker image
|
# Use this script to locally build the docker image
|
||||||
echo "Build with tag=${TAG} BRANCH=${BRANCH} platforms?=${PLATFORMS}"
|
echo "Build with tag=${TAG} BRANCH=${BRANCH} dev?=${DEV} platforms?=${PLATFORMS} VERSION=${VERSION}"
|
||||||
docker buildx build --push --platform $PLATFORMS \
|
docker buildx build --push --platform $PLATFORMS \
|
||||||
--allow security.insecure \
|
--build-arg VERSION=$VERSION \
|
||||||
-t hemna6969/aprsd:$VERSION \
|
-t hemna6969/aprsd:$VERSION \
|
||||||
-t hemna6969/aprsd:$TAG \
|
-t hemna6969/aprsd:$TAG \
|
||||||
-t hemna6969/aprsd:latest \
|
-t hemna6969/aprsd:latest \
|
||||||
-t harbor.hemna.com/hemna6969/aprsd:$TAG \
|
|
||||||
-t harbor.hemna.com/hemna6969/aprsd:$VERSION \
|
|
||||||
-t harbor.hemna.com/hemna6969/aprsd:latest \
|
|
||||||
-f Dockerfile .
|
-f Dockerfile .
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user