-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Enhanced Dockerfile and update GHA workflows #14685
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
Conversation
| args = { | ||
| JEKYLL_ENV = JEKYLL_ENV | ||
| } | ||
| no-cache-filter = ["upstream-resources"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to the no-cache-filter there is no need to use docker build --no-cache. Just this specific stage will be invalidated.
26543e2 to
2c659c0
Compare
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
2c659c0 to
bddf9b5
Compare
| FROM gem AS htmlproofer | ||
| RUN --mount=type=bind,from=generate,source=/out,target=_site \ | ||
| --mount=type=cache,target=/usr/local/bundle \ | ||
| htmlproofer ./_site \ | ||
| --disable-external \ | ||
| --internal-domains="docs.docker.com,docs-stage.docker.com,localhost:4000" \ | ||
| --file-ignore="/^./_site/engine/api/.*$/,./_site/registry/configuration/index.html" \ | ||
| --url-ignore="/^/docker-hub/api/latest/.*$/,/^/engine/api/v.+/#.*$/,/^/glossary/.*$/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the htmlproofer check in our Dockerfile so we can also check locally.
6696ddd to
e19b527
Compare
5ac3791 to
baed1ac
Compare
|
Since this PR and switch to Jekyll 4.2.2, there is a conflict being reported: https://app.netlify.com/sites/docsdocker/deploys/62783880dcb06f000a4f7d25#L243 Looks like we push an |
Yes, that looks a bit suspicious. https://github.com/docker/docker.github.io/blob/master/docker-hub/api/latest/index.html looks to have a redirect in it (but the redirect is to the page itself? Given that the |
| # Update me once in a while: https://github.com/github/pages-gem/releases | ||
| # Please ensure, before upgrading, that this version exists as a tag in starefossen/github-pages here: | ||
| # https://hub.docker.com/r/starefossen/github-pages/tags/ | ||
| # |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any of this information useful to keep somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not relevant anymore since we use a vanilla Ruby image.
|
|
||
| # Engine | ||
| ARG ENGINE_BRANCH="20.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the new format to describe arguments (to allow the docker buildx outline feature to describe things?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we could but these args will be removed in this follow-up if we are ok with it. See crazy-max/docker-docs@enhanced-dockerfile...crazy-max:fetch-remote-plugin
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| - ee | ||
| - index.html | ||
| - js/metadata.json | ||
| - LICENSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this exclude LICENSE from the final image? (wondering if we need to keep it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes was not sure if it's relevant to have the LICENSE and README.md on the website actually:
Maybe better in a separate PR for this one?
baed1ac to
a272949
Compare
|
You might be interested by this one @StefanScherer if you want to take a look |
a272949 to
2311283
Compare
thaJeztah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
| PLATFORMS | ||
| x86_64-linux |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this affect things when building on an M1 ? (or do we not have an arm64 image either way?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaik it will not break anything. It just says that this lock has been generated on this platform. We can add more of them which should be supported using bundle lock --add-platform .... As I can see the official ruby image support a bunch of platforms for the 2.6.10 tag we use:
So I would say we could add them. Or at least linux/arm64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok tested on M1 and it just adds aarch64-linux to the list of platforms in the lock file. I've updated the lock file with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also tried building on raspberry which seems to work fine. So I also added arm-linux.
$ uname -a
Linux foo 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l GNU/Linux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Living on the edge; building it on a rPI! 😂
bbf4303 to
5287e71
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
5287e71 to
0f493a1
Compare
thaJeztah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
StefanScherer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks! |



This is a follow-up of #14644 (comment) to start working with the native netlify client to leverage the possibility to fetch remote resources.
This PR is just a prep to handle that because the current Dockerfile use a quite old jekyll image
starefossen/github-pages:198(~3 years old) that doesn't support some Gem dependencies.Instead of relying on a pre-built Jekyll image I switched to a vanilla ruby image.
I also vendor and push the Gemfile.lock in the repo as it should so we can pin to a specific Jekyll version as well as the plugins being used in our configuration. Atm it's Jekyll 4.2.2. I have created a dedicated stage to vendor our Gemfile in case we want to update and vendor the lock file ourselves:
$ make vendor # or $ docker buildx bake vendorThis is important so we are sync with our lock file while installing dependencies and deploying. Otherwise we could have unexpected behaviors if Jekyll or its plugins are updated. Same spirit as the
go.sum.I have also updated the GHA workflows accordingly. Also merge our
build-*.ymlaltogether as there are some dedup logic that can be mutualized. Let me know what you think about this one.