[Github Action] WARNING! Your password will be stored unencrypted in /home/runner/.docker/config.json. 해결방법

2024-01-26


사진: Unsplash 의 Hennie Stander


1. 방법

 

자신의 job/[name]/step/ 하단 레벨에  # docker login 아래의 코드를 추가한다.

# docker build & push to production EXAMPLE  은 이후 빌드 배포에 대한 예시코드로 참고하면 된다.

 

# docker login
- name: Docker login
  uses: docker/login-action@v2
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}

# docker build & push to production EXAMPLE 
- name: Docker build & push to prod
  if: contains(github.ref, 'main')
  run: |
    docker build --platform linux/amd64 -f ${{ secrets.DOCKER_FILE_NAME }} -t ${{ secrets.DOCKER_USERNAME }}/image_name .
    docker push ${{ secrets.DOCKER_USERNAME }}/image_name

2. 출처

 

https://github.com/marketplace/actions/docker-login

 

Docker Login - GitHub Marketplace

GitHub Action to login against a Docker registry

github.com

https://stackoverflow.com/questions/66857244/setup-docker-credential-helper-for-docker-login-with-github-actions

 

Setup Docker Credential Helper for Docker Login with GitHub Actions

I have a project where I use GitHub Actions to build and push my image to the Docker registry. I use a shell script to do the Docker login and I get this message: WARNING! Your password will be sto...

stackoverflow.com


메인 이미지 출처 : 사진: UnsplashHennie Stander