Closed Jinnrry closed 1 year ago
Can you add this action before the login-action and test if it works?
- name: Docker info
run: |
docker version
docker info
Thank you! I've found the problem. The reason for this is that Gitea's Ubuntu container is not the same as Github's ubuntu container. There is a discussion on this issues and following the comments on this issues can be resolved.
https://forum.gitea.com/t/how-to-use-docker-login-action/7171
I can't run docker/login-action using docker deploy gitea and act-runner, can anyone help me?
On the physical machine, I've added the
git
user to thedocker
user group. I am able to execute docker commands successfully using thegit
user.The action is executable successfully at Github.
My Gitea Server docker-compose file
``` version: "3" networks: gitea: external: false services: server: image: gitea/gitea:1.20.4 container_name: gitea environment: - USER_UID=1001 - USER_GID=1001 - GITEA__database__DB_TYPE=postgres - GITEA__database__HOST=db:5432 - GITEA__database__NAME=gitea - GITEA__database__USER=gitea - GITEA__database__PASSWD=xxx restart: always networks: - gitea volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro - /home/git/.ssh/:/data/git/.ssh ports: - "80:3000" - "127.0.0.1:2222:22" depends_on: - db db: image: postgres:14 restart: always environment: - POSTGRES_USER=gitea - POSTGRES_PASSWORD=xxx - POSTGRES_DB=gitea networks: - gitea volumes: - ./postgres:/var/lib/postgresql/data ```act-runner startup commands
``` docker run \ -e GITEA_INSTANCE_URL=http://xxxxx \ -e GITEA_RUNNER_REGISTRATION_TOKEN=xxxxxx \ --privileged \ --name gitea_act_runner -d vegardit/gitea-act-runner:dind-latest ```My Action:
``` name: Docker Image CI on: [workflow_dispatch,push] env: REGISTRY: registry.cn-hangzhou.aliyuncs.com jobs: build-and-push-image: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Get version id: get_version run: echo "VERSION=$(date -d today +"%Y%m%d%H%M%S")" >> ${GITHUB_ENV} - uses: actions/checkout@v3 - name: Log in to the Container registry uses: docker/login-action@v2.1.0 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.DOCKERUSER }} password: ${{ secrets.DOCKERPWD }} - name: Build and push Docker images uses: docker/build-push-action@v4 with: context: . push: true tags: | xxxxxxxxx:${{ env.VERSION }} xxxxxxxxx:latest ```The Action Log
``` 2023/9/19 GMT+8 17:00:01 Logging into registry.cn-hangzhou.aliyuncs.com... 2023/9/19 GMT+8 17:00:01 ::error::permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%252Fvar%252Frun%252Fdocker.sock/v1.24/auth": dial unix /var/run/docker.sock: connect: permission denied ```