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

How to get image locally #159

Open
delfick opened this issue Nov 12, 2022 · 5 comments
Open

How to get image locally #159

delfick opened this issue Nov 12, 2022 · 5 comments

Comments

@delfick
Copy link

delfick commented Nov 12, 2022

Hello

I'm trying to use the builder on the example project and I can't quite work it out

I did a git clone [email protected]:home-assistant/addons-example.git and from the addons-example directory did:

docker run \
  --rm \
  -it \
  --name builder \
  --privileged \
  -v $(pwd)/example:/data \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  homeassistant/aarch64-builder \
  --target /data    --aarch64  -d local
[23:41:53] INFO: No crossbuild support on host
[23:41:53] INFO: Using host docker setup with '/var/run/docker.sock'
[23:41:53] INFO: Run addon build for: aarch64
[23:41:53] INFO: Init cache for local/aarch64-addon-example:1.2.0 with tag latest and platform linux/arm64
[23:42:00] WARNING: No cache image found. Disabling cache for this build.
[23:42:00] INFO: Run build for local/aarch64-addon-example:1.2.0 with platform linux/arm64
WARNING: No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[+] Building 1.8s (7/7) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                     0.0s
 => => transferring dockerfile: 410B                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                          0.0s
 => [internal] load metadata for ghcr.io/home-assistant/aarch64-base:3.15                                                                                0.4s
 => CACHED [1/3] FROM ghcr.io/home-assistant/aarch64-base:3.15@sha256:005f1df70301d335e050c8db253e69a8b7862b6f1f6ffa31f686751bb165a6e2                   0.0s
 => => resolve ghcr.io/home-assistant/aarch64-base:3.15@sha256:005f1df70301d335e050c8db253e69a8b7862b6f1f6ffa31f686751bb165a6e2                          0.0s
 => [internal] load build context                                                                                                                        0.1s
 => => transferring context: 1.70kB                                                                                                                      0.1s
 => [2/3] RUN     curl -sSLf -o /usr/bin/tempio     "https://github.com/home-assistant/tempio/releases/download/2021.09.0/tempio_aarch64"                1.3s
 => [3/3] COPY rootfs /                                                                                                                                  0.0s
[23:42:02] INFO: Finish build for local/aarch64-addon-example:1.2.0
[23:42:02] INFO: Create image tag: latest
Error response from daemon: failed to find image local/aarch64-addon-example:1.2.0: docker.io/local/aarch64-addon-example:1.2.0: image not known

I'm on MacOS Monterey 12.6 (M1 2020 Macbook Pro)
Using podman 4.3.1

Is there an option so that the built image is available to my local podman without pushing it to a docker registry?

@ludeeus
Copy link
Member

ludeeus commented Nov 12, 2022

Pass in --test as an argument

@delfick
Copy link
Author

delfick commented Nov 12, 2022

even with --test it does the same thing

╰─ docker run \
  --rm \
  -it \
  --name builder \
  --privileged \
  -v $(pwd)/example:/data \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  homeassistant/aarch64-builder \
  --target /data    --aarch64  -d local --test
[03:20:41] INFO: No crossbuild support on host
[03:20:41] INFO: Using host docker setup with '/var/run/docker.sock'
[03:20:41] INFO: Run addon build for: aarch64
[03:20:41] INFO: Init cache for local/aarch64-addon-example:1.2.0 with tag latest and platform linux/arm64
[03:20:46] WARNING: No cache image found. Disabling cache for this build.
[03:20:46] INFO: Run build for local/aarch64-addon-example:1.2.0 with platform linux/arm64
WARNING: No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[+] Building 4.7s (7/7) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                  0.0s
 => => transferring dockerfile: 425B                                                                                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                                                                                     0.0s
 => => transferring context: 2B                                                                                                                                                                       0.0s
 => [internal] load metadata for ghcr.io/home-assistant/aarch64-base:3.15                                                                                                                             0.3s
 => CACHED [1/3] FROM ghcr.io/home-assistant/aarch64-base:3.15@sha256:005f1df70301d335e050c8db253e69a8b7862b6f1f6ffa31f686751bb165a6e2                                                                0.0s
 => => resolve ghcr.io/home-assistant/aarch64-base:3.15@sha256:005f1df70301d335e050c8db253e69a8b7862b6f1f6ffa31f686751bb165a6e2                                                                       0.0s
 => [internal] load build context                                                                                                                                                                     0.2s
 => => transferring context: 1.70kB                                                                                                                                                                   0.1s
 => [2/3] RUN     curl -sSLf -o /usr/bin/tempio     "https://github.com/home-assistant/tempio/releases/download/2021.09.0/tempio_aarch64"                                                             4.3s
 => [3/3] COPY rootfs /                                                                                                                                                                               0.0s
[03:20:51] INFO: Finish build for local/aarch64-addon-example:1.2.0
[03:20:51] INFO: Create image tag: latest
Error response from daemon: failed to find image local/aarch64-addon-example:1.2.0: docker.io/local/aarch64-addon-example:1.2.0: image not known

@delfick
Copy link
Author

delfick commented Nov 19, 2022

Hi, it seems even in github actions I have the same problem

delfick/photons@9636969

Screen Shot 2022-11-20 at 1 36 07 am

Screen Shot 2022-11-20 at 1 35 18 am

Screen Shot 2022-11-20 at 1 35 32 am

@djmaze
Copy link

djmaze commented Nov 21, 2022

Having the same problem.

I think the --load flag for buildx is missing and I don't understand why this has been working at all.

@djmaze
Copy link

djmaze commented Nov 22, 2022

Adding the --load flag to the buildx command indeed makes it work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants