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

ERROR: "docker buildx build" requires exactly 1 argument. #47

Closed
taherafridi opened this issue May 26, 2024 · 15 comments
Closed

ERROR: "docker buildx build" requires exactly 1 argument. #47

taherafridi opened this issue May 26, 2024 · 15 comments
Assignees
Labels
bug Something isn't working compatibility It doesn't work on my machine :(

Comments

@taherafridi
Copy link

When I run "./setup.sh" I get the following error:

Building Docker image 'gpt-home' for ARMhf...
ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build
Docker build failed. Exiting...
cosmo@cosmo:~ $ 

@judahpaul16
Copy link
Owner

What is the output of docker buildx version?

@judahpaul16 judahpaul16 added the bug Something isn't working label May 26, 2024
@judahpaul16 judahpaul16 self-assigned this May 26, 2024
@taherafridi
Copy link
Author

Hi, this is what I get:

cosmo@cosmo:~ $ docker buildx version
github.com/docker/buildx v0.14.0 171fcbeb69d67c90ba7f44f41a9e418f6a6ec1da

Appreciate your help, this is a very exciting project and I am a super newbie to all this, specially all the scripting stuff. But I'm almost there hopefully to get this to work! Thank you

@judahpaul16
Copy link
Owner

No worries. I should note if you run the script with the --no-build flag then you don't have to worry about buildx. The script will just pull the latest prebuilt docker image from DockerHub:

./setup.sh --no-build

Otherwise, try building the container manually and note any error on the way:

# delete the repo folder if exists
[ -d ~/gpt-home ] && rm -rf ~/gpt-home
# clone the repo
git clone https://github.com/judahpaul16/gpt-home ~/gpt-home
cd ~/gpt-home

# Check if the buildx builder exists, if not create and use it
if ! docker buildx ls | grep -q mybuilder; then
    docker buildx create --name mybuilder --use
    docker buildx inspect --bootstrap
fi

# Building Docker image 'gpt-home' for ARMhf architecture
timeout 3600 docker buildx build --platform linux/arm64 -t gpt-home --load .

@taherafridi
Copy link
Author

Thanks!!

I tried with --no-build and got the following error. Not sure what it means.

Using default tag: latest
latest: Pulling from judahpaul/gpt-home
no matching manifest for linux/arm/v7 in the manifest list entries
Unable to find image 'api:latest' locally
docker: Error response from daemon: pull access denied for api, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
Error: No such container: gpt-home

Will try the second suggestion and manually build the container.

@taherafridi
Copy link
Author

taherafridi commented May 26, 2024

Tried the manual way and got this error executing the last line:
timeout 3600 docker buildx build --platform linux/arm64 -t gpt-home --load .

Error:

`cosmo@cosmo:~/gpt-home $ timeout 3600 docker buildx build --platform linux/arm64 -t gpt-home --load .
[+] Building 2.5s (6/21)                                                                            docker-container:mybuilder
 => [internal] load build definition from Dockerfile                                                                      0.0s
 => => transferring dockerfile: 4.47kB                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:23.04                                                           0.9s
 => [internal] load .dockerignore                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => CACHED [ 1/17] FROM docker.io/library/ubuntu:23.04@sha256:5a828e28de105c3d7821c4442f0f5d1c52dc16acf4999d5f31a3bc0f03  0.1s
 => => resolve docker.io/library/ubuntu:23.04@sha256:5a828e28de105c3d7821c4442f0f5d1c52dc16acf4999d5f31a3bc0f03f06edd     0.0s
 => CANCELED [internal] load build context                                                                                1.3s
 => => transferring context: 12.23MB                                                                                      1.2s
 => ERROR [ 2/17] RUN apt-get update && apt-get install -y     ca-certificates software-properties-common wget tar        1.3s
------
 > [ 2/17] RUN apt-get update && apt-get install -y     ca-certificates software-properties-common wget tar:
------
Dockerfile:7
--------------------
   6 |     # Install dependencies
   7 | >>> RUN apt-get update && apt-get install -y \
   8 | >>>     ca-certificates software-properties-common wget tar 
   9 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y     ca-certificates software-properties-common wget tar" did not complete successfully: exit code: 159
cosmo@cosmo:~/gpt-home $ 

`

@judahpaul16
Copy link
Owner

What hardware and OS are you using?

@judahpaul16 judahpaul16 added the compatibility It doesn't work on my machine :( label May 26, 2024
@taherafridi
Copy link
Author

Hi, I'm running on the same parts list for HW, Pi 4b and installed the recommended native OS on it:

cosmo@cosmo:~/gpt-home/contrib $ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

@taherafridi
Copy link
Author

I believe this is where my error is but not sure what to do

cosmo@cosmo:~ $ timeout 3600 docker buildx build --platform linux/arm64 -t gpt-home --load
ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build
cosmo@cosmo:~ $ 

@judahpaul16
Copy link
Owner

I think you're running a 32-bit version of Raspian. Hence the no matching manifest for linux/arm/v7 in the manifest list entries You can verify this with uname -m. I'd suggest reflashing with the latest Raspberry Pi OS (as it's called now) with the Raspberry Pi Imager.

@taherafridi
Copy link
Author

Thanks! I got this response:

cosmo@cosmo:~ $ uname -m
aarch64

I'll reinstall Pi OS as suggested and try again. Thanks!

@judahpaul16
Copy link
Owner

Hmm that suggests you're 64-bit already but it can't hurt to reflash.

Unrelated: I should add this to the README or automate this at some point, but, for Raspberry Pi OS specifically, the i2c interface is disabled by default. If you want to use the little OLED display you have to enable i2c manually.

@taherafridi
Copy link
Author

Thanks! I enabled the i2c. And also installed a fresh clean PI OS 64 as advised.
PS. Sorry about the long feedback below. It's mostly output captures...

I've been doing some digging online and tried bringing my Dockerfile (inside the gpt-home folder) to a bare minimum to test it. It's currently only:

FROM ubuntu:23.04

RUN apt-get update

I still get a similar error:

Checking for existing container 'gpt-home'...
Pruning Docker system...
Total reclaimed space: 0B
Building Docker image 'gpt-home' for ARMhf...
[+] Building 2.3s (5/5) FINISHED                                                        docker-container:mybuilder
 => [internal] load build definition from Dockerfile                                                          0.0s
 => => transferring dockerfile: 75B                                                                           0.0s
 => [internal] load metadata for docker.io/library/ubuntu:23.04                                               1.1s
 => [internal] load .dockerignore                                                                             0.0s
 => => transferring context: 2B                                                                               0.0s
 => CACHED [1/2] FROM docker.io/library/ubuntu:23.04@sha256:5a828e28de105c3d7821c4442f0f5d1c52dc16acf4999d5f  0.1s
 => => resolve docker.io/library/ubuntu:23.04@sha256:5a828e28de105c3d7821c4442f0f5d1c52dc16acf4999d5f31a3bc0  0.1s
 => ERROR [2/2] RUN apt-get update                                                                            0.9s
------
 > [2/2] RUN apt-get update:
------
Dockerfile:3
--------------------
   1 |     FROM ubuntu:23.04
   2 |     
   3 | >>> RUN apt-get update
   4 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update" did not complete successfully: exit code: 159
Docker build failed. Exiting...
cosmo@cosmo:~ $ 

When I run the command sudo apt-get update in terminal, I get a successful message back:


cosmo@cosmo:~ $ sudo apt-get update
Hit:1 https://deb.nodesource.com/node_20.x nodistro InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://archive.raspberrypi.org/debian bullseye InRelease
Reading package lists... Done
cosmo@cosmo:~ $ 

When I try to run the dockerfile directly from the gpt-home folder, using docker build --no-cache -t gpt-home . I get:

cosmo@cosmo:~/gpt-home $ docker build --no-cache -t gpt-home .
Sending build context to Docker daemon  61.86MB
Step 1/2 : FROM ubuntu:23.04
 ---> 0f1f2ae218c0
Step 2/2 : RUN apt-get update
 ---> Running in 85a628d71244
Get:1 http://ports.ubuntu.com/ubuntu-ports lunar InRelease [267 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports lunar-updates InRelease [109 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports lunar-backports InRelease [99.9 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports lunar-security InRelease [109 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports lunar/main armhf Packages [1709 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports lunar/restricted armhf Packages [8686 B]
Get:7 http://ports.ubuntu.com/ubuntu-ports lunar/universe armhf Packages [17.8 MB]
Get:8 http://ports.ubuntu.com/ubuntu-ports lunar/multiverse armhf Packages [206 kB]
Get:9 http://ports.ubuntu.com/ubuntu-ports lunar-updates/restricted armhf Packages [6634 B]
Get:10 http://ports.ubuntu.com/ubuntu-ports lunar-updates/multiverse armhf Packages [1632 B]
Get:11 http://ports.ubuntu.com/ubuntu-ports lunar-updates/main armhf Packages [405 kB]
Get:12 http://ports.ubuntu.com/ubuntu-ports lunar-updates/universe armhf Packages [771 kB]
Get:13 http://ports.ubuntu.com/ubuntu-ports lunar-backports/universe armhf Packages [4203 B]
Get:14 http://ports.ubuntu.com/ubuntu-ports lunar-security/universe armhf Packages [707 kB]
Get:15 http://ports.ubuntu.com/ubuntu-ports lunar-security/restricted armhf Packages [6634 B]
Get:16 http://ports.ubuntu.com/ubuntu-ports lunar-security/multiverse armhf Packages [896 B]
Get:17 http://ports.ubuntu.com/ubuntu-ports lunar-security/main armhf Packages [315 kB]
Fetched 22.5 MB in 7s (3381 kB/s)
Reading package lists...
Removing intermediate container 85a628d71244
 ---> ae93a9ed265b
Successfully built ae93a9ed265b
Successfully tagged gpt-home:latest
cosmo@cosmo:~/gpt-home $ 

@judahpaul16
Copy link
Owner

judahpaul16 commented May 27, 2024

No this is good. It looks like --no-cache was the solution. Docker caches each layer of the Dockerfile to speed up subsequent builds. If an earlier layer is cached with outdated or corrupted data, it could cause errors in later steps like apt-get update. I'll update the workflow file so when the image is built and pushed to DockerHub it'll use --no-cache. Before I do that though could you try rebuilding your test dockerfile again without --no-cache and running the setup script again with --no-build.

See the line:

 => CACHED [1/2] FROM docker.io/library/ubuntu:23.04@sha256:5a828e28de105c3d7821c4442f0f5d1c52dc16acf4999d5f  0.1s

@taherafridi
Copy link
Author

taherafridi commented May 27, 2024

So I did this in the setup.sh file and it worked!

    #timeout 7200 docker buildx build --platform linux/arm64 -t gpt-home . --load
    cd\
    cd gpt-home
    docker build --no-cache -t gpt-home .

The output was:


app                              RUNNING   pid 8, uptime 0:00:09
avahi                            RUNNING   pid 9, uptime 0:00:09
spotifyd                         RUNNING   pid 10, uptime 0:00:09
web-interface                    RUNNING   pid 11, uptime 0:00:09
cosmo@cosmo:~ $ 

The OLED now says

192.168.2.115   38 C
Listening....

Not getting any sound or feedback when I ask it something but I'll troubleshoot and open a new thread for your kind support if anything.

Thank you!

@judahpaul16
Copy link
Owner

That's good but you don't necessarily have to run --no-cache every time. If you try to build again without --no-cache it should work I think. I'm still not quite sure why running the setup script with --no-build gives you the no matching manifest for linux/arm/v7 in the manifest list entries error when your hardware and OS look like they are arm64.

judahpaul16 added a commit that referenced this issue May 27, 2024
judahpaul16 added a commit that referenced this issue May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility It doesn't work on my machine :(
Projects
None yet
Development

No branches or pull requests

2 participants