GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Can't build the docker image on Win 10 · Issue #1905 · InfiniTimeOrg/InfiniTime

Can't build the docker image on Win 10 #1905

New issue
Copy link
New issue
Copy link
Closed
#2181
Closed
Can't build the docker image on Win 10#1905
#2181
Copy link
Labels
bugSomething isn't workingSomething isn't working

Description

@Nobody2303
Nobody2303
opened on Nov 7, 2023
Issue body actions

Verification

  • I searched for similar issues (including closed issues) and found none was relevant.

Introduce the issue

I just set up Docker v4.25.0
I cloned the infinitime repo and also update the submodules.

Upon trying to build the docker image, I ran into the following issue, which I can't really resolve as it's the first time for me to work with docker.


[+] Building 1.7s (13/15)                                                                                                                   docker:default
 => [internal] load .dockerignore                                                                                                                     0.0s
 => => transferring context: 2B                                                                                                                       0.0s
 => [internal] load build definition from Dockerfile                                                                                                  0.0s
 => => transferring dockerfile: 1.36kB                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/ubuntu:22.04                                                                                       1.1s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                                                         0.0s
 => [ 1/10] FROM docker.io/library/ubuntu:22.04@sha256:2b7412e6465c3c7fc5bb21d3e6f1917c167358449fecac8176c6e496e5c1f05f                               0.0s
 => [internal] load build context                                                                                                                     0.0s
 => => transferring context: 30B                                                                                                                      0.0s
 => CACHED [ 2/10] RUN apt-get update -qq     && apt-get install -y       bash       build-essential       cmake       git       make       python3   0.0s
 => CACHED [ 3/10] RUN pip3 install adafruit-nrfutil                                                                                                  0.0s
 => CACHED [ 4/10] RUN pip3 install -Iv cryptography==3.3                                                                                             0.0s
 => CACHED [ 5/10] RUN pip3 install cbor                                                                                                              0.0s
 => CACHED [ 6/10] RUN npm i [email protected] -g                                                                                                    0.0s
 => CACHED [ 7/10] COPY build.sh /opt/                                                                                                                0.0s
 => ERROR [ 8/10] RUN bash -c "source /opt/build.sh; GetGcc;"                                                                                         0.4s
------
 > [ 8/10] RUN bash -c "source /opt/build.sh; GetGcc;":
: invalid option.sh: line 5: set: -
0.348 set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
: invalid option.sh: line 6: set: -
0.348 set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
0.348 /opt/build.sh: line 7: $'\r': command not found
0.348 /opt/build.sh: line 13: $'\r': command not found
0.349 /opt/build.sh: line 17: $'\r': command not found
0.350 /opt/build.sh: line 21: $'\r': command not found
0.352 /opt/build.sh: line 24: $'\r': command not found
0.352 /opt/build.sh: line 26: $'\r': command not found
0.353 /opt/build.sh: line 27: syntax error near unexpected token `$'{\r''
'.353 /opt/build.sh: line 27: `main() {
0.353 bash: line 1: GetGcc: command not found
------
Dockerfile:48
--------------------
  46 |     # Lets get each in a separate docker layer for better downloads
  47 |     # GCC
  48 | >>> RUN bash -c "source /opt/build.sh; GetGcc;"
  49 |     # NrfSdk
  50 |     RUN bash -c "source /opt/build.sh; GetNrfSdk;"
--------------------
ERROR: failed to solve: process "/bin/sh -c bash -c \"source /opt/build.sh; GetGcc;\"" did not complete successfully: exit code: 127

If anyone could give me a hint what might not work I'd be very happy.

Preferred solution

No response

Version

v1.13.0

Reacted by TailyFair

Activity

  1. Nobody2303 commented on Nov 9, 2023

    @Nobody2303
    Nobody2303
    on Nov 9, 2023
    Author
    More actions

    So I did a little Research and knowledge building about docker in it self on my own.
    I was able to alter the Dockerfile to get a plain image which i can run with sleep infinity and debug contents with docker exec.

    What I found out is for some reason the RUN commands seemingly are not performed as a specific user so /opt/build.sh will not be executable.

    Additionally I had to convert all CarriageReturn LineFeeds to LineFeeds only, most certainly due to the way how I cloned the git repo to my windows machine... should also considering re-cloning the whole repo with proper line feed alteration settings, like pull as is

    By using the following lines I can make sure I see what is in the /opt folder during image build time and build.sh will actually execute

    # Lets get each in a separate docker layer for better downloads
    # GCC
    RUN su root && export PATH=$PATH:/opt && ls -l /opt && build.sh GetGcc
    

    but unfortunately this will start a complete build process not just installing GCC so the process is asking for CMakeLists.txt to be inside /sources folder inside the container during docker image build time, which makes no sense to me.

    Could someone please elaborate how this is intended to work?

    • Are we supposed to build the image and then transfer the repo content into the docker container to build?
    • Do we issue a git command from within the container to get the sources in the compilation environment?
    • Should we mount /sources to be the repo folder on my C: drive for the process to work?

    Anyhow currently image build will only be a success if I don't try to execute build.sh at all

  2. Nobody2303 commented on Nov 11, 2023

    @Nobody2303
    Nobody2303
    on Nov 11, 2023
    Author
    More actions

    So after some further research and tweaking I got the container to work properly.
    I had to add the following line at the 3rd or 4th line
    USER root to explicitly run the commands as root otherwise they would not succeed.
    The docker run command from the documentation also needed to be altered to my specific folder structure as well with --user root to actually run the build process properly.
    Well at least to the point where nimble lib is build then the build exits with error 2 at 35% of total build process... also some font file it seems to be not created as well due to an error...
    I already suspect this being potentially related to line end conversion issues as I'm working on a windows system.

  3. Nobody2303 commented on Nov 15, 2023

    @Nobody2303
    Nobody2303
    on Nov 15, 2023
    Author
    More actions

    So Finally I was able to build the stock Firmware from the Repository and have a relyable start point for further development.

    Memory region         Used Size  Region Size  %age Used
               FLASH:      377492 B     474632 B     79.53%
         SPARE_SPACE:          0 GB        12 KB      0.00%
                 RAM:       64368 B        64 KB     98.22%
    post build steps for pinetime-mcuboot-app-1.13.0
       text    data     bss     dec     hex filename
     377492     940   63420  441852   6bdfc pinetime-mcuboot-app-1.13.0.out
    post build (DFU) steps for pinetime-mcuboot-app-1.13.0
    Zip created at pinetime-mcuboot-app-dfu-1.13.0.zip
    [100%] Built target pinetime-mcuboot-app
    + BUILD_RESULT=0
    + return 0
    + BUILD_RESULT=0
    

    The remaining issue was related to Line End conversion most certainly caused by the line end conversion local or global .gitconfic autocrlf set to true prior loading the repository the first time.
    So I completely reloaded the repo and it's submodules while ensuring autocrlf is at least set to input.

    So in the end I just needed

    1. a properly (without line conversion applied) cloned repository.
    2. The line "USER root" on line 4
    3. Change the ${PWD} variable from the docker run call in Documentation to my actual path in windows notation
    4. Setting --user root in the docker run command instead of the recommended --user $(id -u):$(id -g)

    should I commit the gained knowledge as documentation advice for review? @JF002 @NeroBurner @Riksu9000 @minacode

    Reacted by TailyFair
  4. FintasticMan commented on Nov 28, 2023

    @FintasticMan
    FintasticMan
    on Nov 28, 2023
    Member
    More actions

    Yes, I would add that to the docs in a PR.

  5. JF002 commented on Dec 10, 2023

    @JF002
    JF002
    on Dec 10, 2023
    Collaborator
    More actions

    @Nobody2303 Thanks for documenting all your findings about building the docker image on Win 10!
    Do you have any idea if it would be possible to edit the docker file and scripts such that it would build seamlessly on Linux AND Windows?

    If I understand correctly, the image is built and ran as user root, which, to the point of view of a Linux user, does not seem right (this will create build artifacts in the user directory that are owned by root instead of the actual user.

  6. Nobody2303 commented on Dec 13, 2023

    @Nobody2303
    Nobody2303
    on Dec 13, 2023
    Author
    More actions

    @JF002 @FintasticMan Sry for the late reply. Christmas preparations are keeping me from pursuing this topic.

    Currently I have no concrete Idea but I think it should be possible to select a fitting dockerfile and infinitime build command from within an OS detection mechanism...

    Reacted by TailyFair
  7. mark9064
    added
    bugSomething isn't workingSomething isn't working
    on Nov 19, 2024
  8. zyphlar
    added a commit that references this issue on Dec 5, 2024

    Set LF-only (\n) line endings for .sh files to fix InfiniTimeOrg#1905

    This issue will close once commit d360658 is merged into the 'wb/fuzzy-norm' branch.
    d360658
  9. zyphlar
    added a commit that references this issue on Jun 11, 2025

    Set LF-only (\n) line endings for .sh files to fix InfiniTimeOrg#1905

    This issue will close once commit f02e297 is merged into the 'wb/fuzzy-norm' branch.
    f02e297
  10. mark9064
    closed this as completedin #2181on Jun 16, 2025
  11. mark9064
    added a commit that references this issue on Jun 16, 2025

    Set LF-only (\n) line endings for .sh files to fix #1905 (#2181)

    This issue will close once commit 1340f56 is merged into the 'main' branch.
    1340f56
  12. JustScott
    added a commit that references this issue on Jul 29, 2025

    Set LF-only (\n) line endings for .sh files to fix InfiniTimeOrg#1905 (…

    This issue will close once commit a436c49 is merged into the 'main' branch.
    a436c49
  13. metaphys
    added a commit that references this issue on Mar 30, 2026

    Set LF-only (\n) line endings for .sh files to fix InfiniTimeOrg#1905 (…

    This issue will close once commit defea07 is merged into the 'main' branch.
    defea07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.