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

Cannot create image with the dockerfile,return error. #1

Closed
FreeBlues opened this issue Mar 25, 2024 · 5 comments
Closed

Cannot create image with the dockerfile,return error. #1

FreeBlues opened this issue Mar 25, 2024 · 5 comments

Comments

@FreeBlues
Copy link

I'm not particularly familiar with Docker, if need special params, please tell me.
Thanks!

Docker version: 20.10.17. Build 100c701

The log:

(base) pptsde@pptsdedeMacBook-Pro Github % docker build -f ./wp34s-builder/Dockerfile .
[+] Building 0.1s (2/2) FINISHED                                                                                                                 
 => [internal] load build definition from Dockerfile                                                                                        0.0s
 => => transferring dockerfile: 1.77kB                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                           0.0s
 => => transferring context: 2B                                                                                                             0.0s
failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 4: unknown instruction: SET
(base) pptsde@pptsdedeMacBook-Pro Github % 
@SammysHP
Copy link
Owner

Oh, sorry for the inconvenience!

Docker version: 20.10.17

I used pretty new Dockerfile features (more specifically buildkit features) that require a slightly more recent version of Docker. As a workaround, you can force Docker to download the latest specification by inserting the following line at the beginning of the Dockerfile:

# syntax=docker/dockerfile:1

Afterwards you have to change the command for building like this:

docker buildx -t wp34s-builder .

And if that doesn't work, try this instead:

DOCKER_BUILDKIT=1 docker build -t wp34s-builder

(Hint: Make sure to first change into the directory with the Dockerfile, for example cd wp34s-builder.)

With all the changes in Docker it's hard to track which features got added at which time…

@FreeBlues
Copy link
Author

Oh, sorry for the inconvenience!

Docker version: 20.10.17

I used pretty new Dockerfile features (more specifically buildkit features) that require a slightly more recent version of Docker. As a workaround, you can force Docker to download the latest specification by inserting the following line at the beginning of the Dockerfile:

# syntax=docker/dockerfile:1

Afterwards you have to change the command for building like this:

docker buildx -t wp34s-builder .

And if that doesn't work, try this instead:

DOCKER_BUILDKIT=1 docker build -t wp34s-builder

(Hint: Make sure to first change into the directory with the Dockerfile, for example cd wp34s-builder.)

With all the changes in Docker it's hard to track which features got added at which time…

Thank you for your response.
Perhaps the simplest method is to upgrade my Docker to the latest version. I have just completed the upgrade and successfully passed the previous error points, but encountered a new issue where the Wine website is difficult to access, resulting in a failed build. However, I am closer to the finish line, and I need to find a way to resolve this issue.
Thank you again!

Below is the log, maybe it will be helpful to others like me:

(base) pptsde@pptsdedeMacBook-Pro Github % /Applications/Docker.app/Contents/Resources/bin/docker build -f ./wp34s-builder/ .
[+] Building 0.0s (1/1) FINISHED                                                                                            docker:desktop-linux
 => [internal] load build definition from wp34s-builder                                                                                     0.0s
 => => transferring dockerfile: 2B                                                                                                          0.0s
ERROR: failed to solve: failed to read dockerfile: open wp34s-builder: no such file or directory

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/pbcpmci1usulzbkjkg8ftzab8
(base) pptsde@pptsdedeMacBook-Pro Github % /Applications/Docker.app/Contents/Resources/bin/docker build -f ./wp34s-builder/Dockerfile . 
[+] Building 390.2s (7/12)                                                                                                  docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                        0.0s
 => => transferring dockerfile: 1.76kB                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/ubuntu:22.04                                                                             4.0s
 => [internal] load .dockerignore                                                                                                           0.0s
 => => transferring context: 2B                                                                                                             0.0s
 => [internal] preparing inline document                                                                                                    0.0s
 => [base 1/3] FROM docker.io/library/ubuntu:22.04@sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e                 11.4s
 => => resolve docker.io/library/ubuntu:22.04@sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e                       0.0s
 => => sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e 1.13kB / 1.13kB                                              0.0s
 => => sha256:aa772c98400ef833586d1d517d3e8de670f7e712bf581ce6053165081773259d 424B / 424B                                                  0.0s
 => => sha256:ca2b0f26964cf2e80ba3e084d5983dab293fdb87485dc6445f3f7bbfc89d7459 2.30kB / 2.30kB                                              0.0s
 => => sha256:bccd10f490ab0f3fba61b193d1b80af91b17ca9bdca9768a16ed05ce16552fcb 29.54MB / 29.54MB                                            4.9s
 => => extracting sha256:bccd10f490ab0f3fba61b193d1b80af91b17ca9bdca9768a16ed05ce16552fcb                                                   5.9s
 => [base 2/3] RUN <<EOF (set -eux...)                                                                                                     47.4s
 => ERROR [base 3/3] RUN <<EOF (set -eux...)                                                                                              327.3s 
------                                                                                                                                           
 > [base 3/3] RUN <<EOF (set -eux...):                                                                                                           
0.284 + + APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1wget apt-key -nv add -O- -                                                                       
0.284  https://dl.winehq.org/wine-builds/winehq.key                                                                                              
327.3 OpenSSL: error:0A000126:SSL routines::unexpected eof while reading                                                                         
327.3 Unable to establish SSL connection.
327.3 gpg: no valid OpenPGP data found.
------
Dockerfile:17
--------------------
  16 |     ARG WINE_BRANCH="stable"
  17 | >>> RUN <<EOF
  18 | >>>   set -eux
  19 | >>>   wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
  20 | >>>   echo "deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list
  21 | >>>   dpkg --add-architecture i386
  22 | >>>   apt-get update
  23 | >>>   DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends winehq-${WINE_BRANCH}
  24 | >>>   rm -rf /var/lib/apt/lists/*
  25 | >>>   wget -nv -O /usr/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
  26 | >>>   chmod +x /usr/bin/winetricks
  27 | >>> EOF
  28 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c   set -eux\n  wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -\n  echo \"deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main\" >> /etc/apt/sources.list\n  dpkg --add-architecture i386\n  apt-get update\n  DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends winehq-${WINE_BRANCH}\n  rm -rf /var/lib/apt/lists/*\n  wget -nv -O /usr/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks\n  chmod +x /usr/bin/winetricks\n" did not complete successfully: exit code: 2

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/ei9s8ss1jiiuh0j4450ua9tln
(base) pptsde@pptsdedeMacBook-Pro Github %

@FreeBlues
Copy link
Author

A wonderful news! After several steps I got the calc.bin!
New issue is coming: I need to learn how to "flash" the calc.bin to the emulator on macOS. but it is another job.

Your docker image is very useful!
Thanks a lot!

@SammysHP
Copy link
Owner

SammysHP commented Mar 26, 2024

Glad to hear it worked!

Updating the calculator was tricky. I tried various USB-TTL adapters (PL2303, CH340, FT232) and only the FTDI worked – but not on my ThinkPad T14 Gen 4, only on my old ThinkPad X220 and a Dell Precision 7530.

I used the wp34sflashcmd program available from the WP 34S SourceForge repo. It requires an old Qt4 version. I didn't want to install it and it needs just a few data types, so I called it in a somehow dirty way…

LD_PRELOAD=qt4/usr/lib/libQtCore.so.4 ./wp34sflashcmd calc.bin /dev/ttyUSB0

Not sure how it's done under macOS unfortunately.

@FreeBlues
Copy link
Author

Glad to hear it worked!

Updating the calculator was tricky. I tried various USB-TTL adapters (PL2303, CH340, FT232) and only the FTDI worked – but not on my ThinkPad T14 Gen 4, only on my old ThinkPad X220 and a Dell Precision 7530.

I used the wp34sflashcmd program available from the WP 34S SourceForge repo. It requires an old Qt4 version. I didn't want to install it and it needs just a few data types, so I called it in a somehow dirty way…

LD_PRELOAD=qt4/usr/lib/libQtCore.so.4 ./wp34sflashcmd calc.bin /dev/ttyUSB0

Not sure how it's done under macOS unfortunately.

Yes, I have encountered many issues as well. When I attempted to update the firmware, unfortunately, the first Arduino Nano board I purchased used a CH340 chip. At the time, the seller advertised it as an "improved" Arduino Nano V3. After researching online, I realized it was indeed an "improved" version because the FTDI chip is more expensive. Subsequently, I bought several TTL boards, and in the end, it was an Arduino Nano with an FTDI chip that worked.
I also used the wp34sflash tool and tried at least 20 times before I saw the successful connection screen. I was using it on macOS, and I can only say that it does work, but it requires you to have sufficient patience and good luck.

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

2 participants