Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use port on LHS in WITH DOCKER --load alongside --use-registry-for-with-docker #2071

Closed
rrjjvv opened this issue Aug 3, 2022 · 2 comments · Fixed by #2076
Closed
Assignees
Labels
type:bug Something isn't working

Comments

@rrjjvv
Copy link
Contributor

rrjjvv commented Aug 3, 2022

Reproduction should make it clearer:

VERSION --use-registry-for-with-docker 0.6

wrapped:
    FROM alpine
    SAVE IMAGE wrapped-alpine

load-port:
    FROM earthly/dind:alpine
    WITH DOCKER --load example.com:9999/img=+wrapped
        RUN echo "broke"
    END

load-no-port:
    FROM earthly/dind:alpine
    WITH DOCKER --load example.com/img=+wrapped
        RUN echo "this works"
    END

I would expect both to behave identically, but the usage of a port in the alias results in failure.

$ earthly --version 
earthly version v0.6.20 ad869c06c884b10f88948b5852ab22b4d7262e20 linux/amd64; Ubuntu 20.04.4 LTS (Focal Fossa)

# works as expected; showing output for comparison sake
$ earthly --no-cache -P +load-no-port
<snip>
       +load-no-port | Loading images from BuildKit via embedded registry...
       +load-no-port | Pulling 172.30.0.1:8371/sess-w317eepv6emwhvng0dx18uphy/example.com/img:latest and retagging as example.com/img:latest
<snip>

# broken; "my" custom port (semicolon) results in a badly formatted name
$ earthly --no-cache -P +load-port
<snip>
         +load-port | Loading images from BuildKit via embedded registry...
          +load-port | Pulling 172.30.0.1:8371/sess-op7ikdxqh6ag10avh9yzdsayd/example.com:9999/img and retagging as example.com:9999/img
          +load-port | invalid reference format
          +load-port | ERROR: Command exited with non-zero code: WITH DOCKER RUN --privileged echo "broke"
<snip>

I suspect the fix is an extension of bf27e1c, a very similar (but not quite as trivial).


This isn't a blocker by any means; this is specific to --use-registry-for-with-docker (still experimental, last I knew). Usage of a port might sound silly on the surface, but my scenario is in the spirit of #1797 (I am pushing to a corporate registry that listens on a non-standard port). Re-tagging inside WITH DOCKER would be an easy workaround. My usage of --use-registry-for-with-docker in this context was trying to diagnose a separate issue (which I may file separately).

@vladaionescu
Copy link
Member

Thanks for the report @rrjjvv! This has been fixed in the latest release!

@rrjjvv
Copy link
Contributor Author

rrjjvv commented Aug 5, 2022

I saw that, and thanks! I can now use the registry as a permanent solution/workaround for the performance issues that resulted in #2072.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants