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

buildx failed with: ERROR: failed to solve: invalid user index: -1 #1408

Open
inductor opened this issue Nov 15, 2022 · 2 comments
Open

buildx failed with: ERROR: failed to solve: invalid user index: -1 #1408

inductor opened this issue Nov 15, 2022 · 2 comments

Comments

@inductor
Copy link

Hello,

I'm using buildx on GHA and I get the following error. I've never seen this but does anyone know what's causing this?

ref. https://github.com/mastodon/mastodon/actions/runs/3470550179/jobs/5798997043

@jedevc
Copy link
Collaborator

jedevc commented Nov 15, 2022

This seems related to moby/buildkit#2987.

I think it should work if replaced with the numerical UID - but as mentioned in the replies there, it's not supported to use --chown with names and --link together based on how --link works.

Your error message is definitely quite horrible though, I think it should be possible to improve.

@polarathene
Copy link

polarathene commented Jan 19, 2023

I ran into the same error, and didn't see this issue when I searched for some reason 😅

I've shared full logs if helpful as I know linking to CI run logs becomes an invalid link eventually. I am able to use --chown with --link together with just BuildKit, but noticed it's failing with buildx and the docker-container driver.

UPDATE: This was a misunderstanding on my part. I didn't realize Docker Engine 20.10.22 from Dec 2022 still used BuildKit 0.8.4 from Apr 2021

I think it should work if replaced with the numerical UID

Numeric ID values do work 👍

it's not supported to use --chown with names and --link together based on how --link works.

It'd be helpful if docs could highlight that.

There is no mention of them being incompatible, just about knowledge of prior layer state (which at the time was a tad vague for me to realize that affected lookup of /etc/passwd from a base image as well. I thought it only meant about target destination to copy to).


I've roughly documented two workarounds if it's helpful to anyone :)

mkakpabla added a commit to mkakpabla/symfony-boilerplate that referenced this issue Feb 27, 2023
Ngob pushed a commit to thecodingmachine/symfony-boilerplate that referenced this issue Mar 16, 2023
regisb added a commit to overhangio/tutor that referenced this issue Apr 27, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

TODO:
- Add a `tutor images build --mount` option to automatically mount an
  edx-platform repo at build-time.
- Document how to build an openedx docker image with a local repo.
- Deprecate other ways of customising the openedx Docker image (private
  requirements, extra xblocks, etc.)

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Apr 27, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

TODO:
- Add a `tutor images build --mount` option to automatically mount an
  edx-platform repo at build-time.
- Document how to build an openedx docker image with a local repo.
- Deprecate other ways of customising the openedx Docker image (private
  requirements, extra xblocks, temporary volumes, etc.)

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Apr 28, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Apr 28, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Apr 28, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Apr 28, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Apr 28, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue May 2, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue May 4, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue May 9, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue May 10, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue May 11, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue May 22, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue May 23, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Jun 5, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Jun 5, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Jun 5, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Jun 5, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Jun 7, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Jun 13, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
regisb added a commit to overhangio/tutor that referenced this issue Jun 14, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
omus added a commit to beacon-biosignals/Ray.jl that referenced this issue Sep 28, 2023
omus added a commit to beacon-biosignals/Ray.jl that referenced this issue Sep 28, 2023
* Add CI workflow to test Dockerfile build

* Build image on change to .dockerignore

* Use numeric UID with `--chown`

docker/buildx#1408 (comment)

* Use resolve

* Trigger Dockerfile CI on changes to build

* Update GitHub actions

* Report Docker image size
moonesque pushed a commit to edSPIRIT/tutor that referenced this issue Nov 20, 2023
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
docker/buildx#1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
Mahoney added a commit to Lidalia-World/lidalia-json that referenced this issue Jan 27, 2024
Mahoney added a commit to Lidalia-World/lidalia-json that referenced this issue Jan 27, 2024
I'm just cargo-culting this link now:
docker/buildx#1408 (comment)
Mahoney added a commit to Lidalia-World/lidalia-json that referenced this issue Feb 2, 2024
manuelodelain pushed a commit to rezozero/nuxt-starter that referenced this issue Nov 18, 2024
* feat: Added new multi-stage Dockerfile and gitlab ci build

* chore: Need to chown with numeric UID instead of user due to docker/buildx#1408

* chore: Update nginx config

* chore: pnpm lint update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants