Giter Site home page Giter Site logo

Comments (3)

derhuerst avatar derhuerst commented on August 15, 2024

Just jumping in here with some pointers to what needs to be done, but don't have the time to do the work...

Currently, the build script has support for 3 versions of Docker (18, 19, 20):

function build_with_data_dir() {
local TAG=${1}
local PULL_ENABLED=${2}
DOCKER_VERSION="$(docker --version | grep "Docker version"| awk '{print $3}' | sed 's/,//')"
case $DOCKER_VERSION in
*"20"*)
if [[ "${PULL_ENABLED}" == "pull" ]]; then
DOCKER_BUILD_COMMAND="docker buildx build --pull"
else
DOCKER_BUILD_COMMAND="docker buildx build"
fi;
;;
*"19"*)
if [[ "${PULL_ENABLED}" == "pull" ]]; then
DOCKER_BUILD_COMMAND="docker build --pull --no-cache"
else
DOCKER_BUILD_COMMAND="docker build --no-cache"
fi;
;;
*"18"*)
if [[ "${PULL_ENABLED}" == "pull" ]]; then
DOCKER_BUILD_COMMAND="docker build --pull --no-cache"
else
DOCKER_BUILD_COMMAND="docker build --no-cache"
fi;
;;
esac
${DOCKER_BUILD_COMMAND} --build-arg GEOSERVER_WEBAPP_SRC=${GEOSERVER_ARTIFACT_DIRECTORY}/geoserver.war \
--build-arg PLUG_IN_PATHS=$PLUGIN_ARTIFACT_DIRECTORY \
--build-arg GEOSERVER_DATA_DIR_SRC=${DATADIR_ARTIFACT_DIRECTORY} \
--build-arg UID=${USERID} --build-arg GID=${GROUPID} --build-arg UNAME=${UNAME} \
--build-arg GIT_HASH=${GIT_HASH_COMMAND} \
-t geosolutionsit/geoserver:"${TAG}-${GEOSERVER_VERSION}" \
.
}
function build_without_data_dir() {
local TAG=${1}
local PULL_ENABLED=${2}
DOCKER_VERSION="$(docker --version | grep "Docker version"| awk '{print $3}' | sed 's/,//')"
case $DOCKER_VERSION in
*"20"*)
docker builder prune --all -f
if [[ "${PULL_ENABLED}" == "pull" ]]; then
DOCKER_BUILD_COMMAND="docker buildx build --pull"
else
DOCKER_BUILD_COMMAND="docker buildx build"
fi;
;;
*"19"*)
if [[ "${PULL_ENABLED}" == "pull" ]]; then
DOCKER_BUILD_COMMAND="docker build --pull --no-cache"
else
DOCKER_BUILD_COMMAND="docker build --no-cache"
fi;
;;
*"18"*)
if [[ "${PULL_ENABLED}" == "pull" ]]; then
DOCKER_BUILD_COMMAND="docker build --pull --no-cache"
else
DOCKER_BUILD_COMMAND="docker build --no-cache"
fi;
;;
esac
${DOCKER_BUILD_COMMAND} --build-arg GEOSERVER_WEBAPP_SRC=${GEOSERVER_ARTIFACT_DIRECTORY}/geoserver.war \
--build-arg PLUG_IN_PATHS=$PLUGIN_ARTIFACT_DIRECTORY \
--build-arg UID=${USERID} --build-arg GID=${GROUPID} --build-arg UNAME=${UNAME} \
--build-arg GIT_HASH=${GIT_HASH_COMMAND} \
-t geosolutionsit/geoserver:"${TAG}-${GEOSERVER_VERSION}" \
.
}

Moby BuildKit and docker buildx, which together allow seamless cross-platform builds, are enabled by default only as of Docker v23.

However, using the DOCKER_BUILDKIT=1 env var, one can opt into BuildKit even with earlier versions of Docker. It seems like, as of Docker Engine 18.06.0-ce, released on 2018-07-18, one can opt into experimental BuildKit.

TLDR: Theoretically, building linux/arm64 images should be possible even with the current setup, with the addition of --platform linux/amd64,linux/arm64 and DOCKER_BUILDKIT=1.

from docker-geoserver.

randomorder avatar randomorder commented on August 15, 2024

Hi @spinnaker1

Thanks for reporting this. It would be nice to have arm64 builds as well. I have not looked into this yet

If you want to have a go at it, the builds are executed by the docker hub itself based on these hook scripts in the root of the repository
https://github.com/geosolutions-it/docker-geoserver/tree/master/hooks

@derhuerst the custom_build script is a helper script for end users to make it easier for them to create a custom image but is not used by the CI in docker hub to build and push the images

To add arm builds the build and push script need an update
here: https://github.com/geosolutions-it/docker-geoserver/blob/master/hooks/build#L28
and
here: https://github.com/geosolutions-it/docker-geoserver/blob/master/hooks/build#L51

with an extra build command and dedicated tag for ARM

and then push commands to be added here: https://github.com/geosolutions-it/docker-geoserver/blob/master/hooks/push#L5-L21 to push the new tags

Finally the test part with the new tags
https://github.com/geosolutions-it/docker-geoserver/blob/master/hooks/test#L3-L11

from docker-geoserver.

derhuerst avatar derhuerst commented on August 15, 2024

with an extra build command and dedicated tag for ARM

I think having one tag with both linux/amd64 & linux/arm64 support would provide more value. (But this should not be a problem if the Docker Hub build environment supports docker buildx, which I assume it does.)

With two separate tags, it is not possible to e.g. write architecture-agnostic Compose files.

from docker-geoserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.