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

[BUG] Docker image build process broken? #2112

Open
ethancrawford opened this issue Jan 30, 2025 · 2 comments
Open

[BUG] Docker image build process broken? #2112

ethancrawford opened this issue Jan 30, 2025 · 2 comments

Comments

@ethancrawford
Copy link
Contributor

ethancrawford commented Jan 30, 2025

Browser

N/A

OS

Windows 11

Screen size

N/A

Describe the bug

I've previously been able to run up the tabler docker image and edit/update the source code in real time as directed in the README.
However, after recently messing about with my local copy, I've since been unable to successfully build and run the docker image.
I'll admit that docker is still not something I'm 100% familiar with, so I may be missing something important, but I thought I knew at least enough to manage the basics - so I'm a little bit stumped as to the cause of the error I'm ending up with.
It manages to trigger gulp start, but then fails during this task a little bit later with the following:

tabler  | [08:37:13] Starting 'build-eleventy'...
tabler  |
tabler  | > @tabler/core@1.0.0 build:html /app
tabler  | > eleventy
tabler  |
tabler  | [11ty] Problem writing Eleventy templates:
tabler  | [11ty] 1. Problem creating an Eleventy Layout for the "./src/pages/2-step-verification-code.html" template file. (via EleventyBaseError)
tabler  | [11ty] 2. You’re trying to use a layout that does not exist: _includes/single (via `layout: single`)

See below in 'How to reproduce' for more about what was going on, and questions I have...

How to reproduce

How I got here:
Before I started having these issues, I had been dealing with updating my local copy of the dev branch, after running into an annoying 'diverging branches' problem, and had assumed I replaced my local dev branch with a fresh copy from origin based on the latest from the tabler repo. Although my guess is that this is (probably?) unrelated, I will also admit that perhaps I'm unaware of something in the process that then caused the docker image build to break.

In any case, after apparently updating my local copy of dev to 9a46a8f:

docker compose up --build failed, because it was complaining about not being able to copy several files into the image: _config.yml and _config_prod.yml, removed in 6783960.

I commented out references to these files in Dockerfile, but the build process still failed, this time with the error message mentioned above. (You’re trying to use a layout that does not exist: _includes/single (via 'layout: single'))

What confuses me

I have seen in the source code that eleventy.config.mjs specifies where to find the layout files, and it seems to me like this config should be working. The version of eleventy is correct enough as far as I can tell, and the file name seems to be specified correctly in 2-step-verification-code.html, so I'm not sure why the layout is not being found.

Any advice about how to successfully get the docker image building again, or feedback about any steps I can try to further troubleshoot this would be gratefully received. Apologies in advance if I've left out something important or done something silly 🙏

Screenshots

No response

JSFiddle

No response

@ethancrawford ethancrawford added the bug Something isn't working label Jan 30, 2025
@codecalm codecalm removed the bug Something isn't working label Feb 3, 2025
@ethancrawford
Copy link
Contributor Author

ethancrawford commented Feb 10, 2025

@codecalm - Apologies for the following wall of text, but I've been attempting to update and build the docker image again, and I'm still running into some issues, which I'm hoping the following information might at least help you to provide some advice on.
I updated my local copy to latest commit, and I'm getting further errors when trying to build the docker image: in addition to the two _config.yml and _config_prod.yml files mentioned above, I see the build process now says that gulpfile.js is also missing (presumably due to #2116):

 => ERROR [tabler 5/9] ADD gulpfile.js /app/                                                                                         0.0s
------
 > [tabler 5/9] ADD gulpfile.js /app/:
------
failed to solve: failed to compute cache key: failed to calculate checksum of ref 9d1c5cba-424a-4902-be39-640d416d7dcc::pwrmhtc67jn5p35fpbiz12guh: "/gulpfile.js": not found

Commenting this line out:

ADD gulpfile.js /app/
allows things to progress further, but the script then stops with:

 ✔ tabler                  Built                                                                                                     0.0s
 ✔ Network tabler_default  Created                                                                                                   0.7s
 ✔ Container tabler        Created                                                                                                   0.0s
Attaching to tabler
tabler  |  ERR_PNPM_NO_SCRIPT_OR_SERVER  Missing script start or file server.js
tabler exited with code 1

I played around a little bit to see if I could find the appropriate script to call in its place, but it's not clear which is the right one.
I blindly tried changing the entrypoint in the Dockerfile to ENTRYPOINT [ "pnpm", "run", "dev" ] (which I now believe is not the right one, but still...) it resulted in this:

recursive_turbo_invocations (https://turbo.build/messages/recursive-turbo-invocations)
tabler  |
tabler  |   × Your `package.json` script looks like it invokes a Root Task (//#dev),
tabler  |   │ creating a loop of `turbo` invocations. You likely have misconfigured your
tabler  |   │ scripts and tasks or your package manager's Workspace structure.
tabler  |    ╭─[/app/package.json:6:1]
tabler  |  6 │     "build": "turbo build",
tabler  |  7 │     "dev": "turbo dev",
tabler  |    ·            ─────┬─────
tabler  |    ·                 ╰── This script calls `turbo`, which calls the script, which calls `turbo`...
tabler  |  8 │     "clean": "turbo clean",
tabler  |    ╰────
tabler  |
tabler  |  ELIFECYCLE  Command failed with exit code 1.

...and the Turborepo docs mention that the name of the script in package.json should be different to the command that follows turbo - so I changed these lines:

tabler/package.json

Lines 6 to 9 in 76f5de4

"build": "turbo build",
"dev": "turbo dev",
"clean": "turbo clean",
"bundlewatch": "turbo bundlewatch",

to:

    "app:build": "turbo build",
    "app:dev": "turbo dev",
    "app:clean": "turbo clean",
    "app:bundlewatch": "turbo bundlewatch",

And ran app:dev as the entry point. Again it progresses further. However, at this point, the script runs to completion, with the following, and then exits:

tabler  | turbo 2.4.0
tabler  |
tabler  | • Running dev
tabler  | • Remote caching disabled
tabler  |
tabler  | No tasks were executed as part of this run.
tabler  |
tabler  |  Tasks:    0 successful, 0 total
tabler  | Cached:    0 cached, 0 total
tabler  |   Time:    37ms
tabler  |

tabler exited with code 0

Would you be able to advise on the correct way to get a dev server & file watcher running during the process?

I'm happy to contribute the fixes that were necessary to get things working if you wouldn't intend to add them yourself.

@ethancrawford
Copy link
Contributor Author

Note, I managed to get things running by manually running pnpm run build in the core directory and then pnpm run dev in the preview directory, but I'm guessing there's possibly a simpler way...

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