On Wed, Sep 15, 2021 at 5:25 PM David P Grove <[email protected]> wrote:
>
> Is there a recommended way to define a Jenkins job that is able to push
> images to dockerhub?
>
We have worked around this for Guacamole builds by creating a
temporary directory to house the Docker configuration and explicitly
overriding HOME when invoking Docker commands requiring login:
# Push to Docker hub (setting HOME variable to avoid sharing
# login credentials with other builds on same Jenkins node)
mkdir -p "local-docker-cfg"
HOME="$PWD/local-docker-cfg" docker login \
--username="$DOCKER_USERNAME" \
--password="$DOCKER_PASSWORD"
HOME="$PWD/local-docker-cfg" docker push "$TAG"
- Mike