J'essaie de pousser une image Docker au référentiel Docker public à l'aide de GitHub Actions à la suite de leur documentation, mais je ne peux pas le faire fonctionner:
name: CI
on:
Push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/docker/login@master
with: # Set the secret as an input
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
env: # Set the secret in the env
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Test
run: mvn clean verify -U
- name: build
run: ./mvnw compile jib:dockerBuild
- name: Push
run: docker Push odfsoft/guess-game:latest
Je reçois l'erreur suivante:
/usr/bin/docker run --name bb8146f4246c56a44203bb2667ccfbdcab81_f18969 --label 04bb81 --workdir /github/workspace --rm -e DOCKER_USERNAME -e DOCKER_PASSWORD -e INPUT_DOCKER_USERNAME -e INPUT_DOCKER_PASSWORD -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/spring-boot-guess-game/spring-boot-guess-game":"/github/workspace" 04bb81:46f4246c56a44203bb2667ccfbdcab81
Error: Cannot perform an interactive login from a non TTY device
est-ce quelque chose qui concerne mon action ou une limitation dans les actions GitHub?
J'ai trouvé l'action de Git Hub: construire et pousser des images Docker
https://github.com/marketplace/action/actions/build-and-push-docker-images
Cela fonctionne bien, j'ai pu construire et pousser l'image Docker à Docker Hub.