Summary
The user is building a Docker image using Gitea Actions on a virtual machine and faces an issue where Earthly attempts to use Docker over the network instead of the Unix socket. They provided their CI configuration, which includes steps for installing Earthly, logging into Docker and GitHub Container Registry, and executing a sample command. The final step fails with a "connection refused" error when pulling the Docker image. The user clarified that the issue is related to the pull ping mechanism connecting to the Earthly Buildkit daemon. A suggested solution was to set EARTHLY_DISABLE_REMOTE_REGISTRY_PROXY=1
, which switched to a tar-based export mechanism and resolved the issue. Additionally, the user noted that this fix also improved performance on macOS by saving approximately 10 seconds per run.
exographicskip44
<@U01EDDAJGFK> Unrelated but this fixed earthly on macos timing out on my end
registry-proxy | Failed to start registry proxy: failed to start Darwin support container: context deadline exceeded
Easily saves ~10s per run
me1548
that fixed it!
vlad
(For context the pull ping mechanism is the fastest usually because it only transfers the layers that differ, but it's also a bit newer and we've seen occasional issues in some environments)
vlad
Yeah.. if you set EARTHLY_DISABLE_REMOTE_REGISTRY_PROXY=1
it should hopefully work
vlad
So the problem here isn't that it's trying to use docker over the network. The pull ping mechanism is used to tell the docker daemon to pull the resulting image from the Earthly Buildkit daemon and for some reason that is failing. Let me see if there's a way to switch to the tar-based export mechanism which perhaps will fix this for you
me1548
build logs are at https://cloud.earthly.dev/builds/f67f4b42-6c7a-426d-83cc-1b37b3345214 in case it matters
me1548
Hey, I'm trying to build a docker image from Gitea Actions via a virtual machine and for some reason Earthly really wants to use Docker over the network instead of using the unix socket.
Here is my CI config:
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
tests:
name: example earthly test
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
steps:
- name: "Install Earthly"
run: |
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL <https://pkg.earthly.dev/earthly.pgp> | sudo gpg --dearmor -o /usr/share/keyrings/earthly-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/earthly-archive-keyring.gpg] <https://pkg.earthly.dev/deb> \
stable main" | sudo tee /etc/apt/sources.list.d/earthly.list > /dev/null
sudo apt-get update
sudo apt-get install -y earthly
- uses: actions/checkout@v4
- name: Docker login # to avoid dockerhub rate-limiting
run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: Log into <http://ghcr.io|ghcr.io>
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: <http://ghcr.io|ghcr.io>
username: xe
password: ${{ secrets.GHCR_TOKEN }}
- name: use sat alpha
run: |
earthly org select me-2625
earthly sat select alpha
docker info
env
- name: run the earthly hello world
run: earthly --verbose <http://github.com/earthly/hello-world:main+hello|github.com/earthly/hello-world:main+hello>```
Here is the error I get in the last step:
``` frontend | Running command: docker pull 127.0.0.1:37195/sess-sljlgg2595wsghmeo8pny8olk/pullping:img-0
earthfile2llb immediate error: failed to SAVE IMAGE: pull ping error: pull ping response: rpc error: code = Unknown desc = image pull: 1 error occurred:
* command failed: docker pull 127.0.0.1:37195/sess-sljlgg2595wsghmeo8pny8olk/pullping:img-0: exit status 1: Error response from daemon: Get "<http://127.0.0.1:37195/v2/>": dial tcp 127.0.0.1:37195: connect: connection refused: exit status 1```
build logs are at <https://cloud.earthly.dev/builds/f67f4b42-6c7a-426d-83cc-1b37b3345214> in case it matters