-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: docker image not building #1724
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
Open
felipecrs
wants to merge
3
commits into
lowlighter:master
Choose a base branch
from
felipecrs:fix-docker-build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,168
−2,072
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,43 @@ | ||
# syntax=docker/dockerfile:1.16 | ||
|
||
# Base image | ||
FROM node:20-bookworm-slim | ||
FROM node:22 | ||
|
||
# Install latest chrome dev package, fonts to support major charsets and skip chromium download on puppeteer install | ||
# Based on https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends wget ca-certificates \ | ||
&& wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ | ||
&& apt-get install -y --no-install-recommends ./google-chrome-stable_current_amd64.deb fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ | ||
&& rm -rf ./google-chrome-stable_current_amd64.deb /var/lib/apt/lists/* | ||
|
||
# Install deno for miscellaneous scripts | ||
# TODO: pin major deno version | ||
COPY --from=denoland/deno:bin /deno /usr/local/bin/deno | ||
|
||
# Install licensed through pkgx | ||
# TODO: pin major pkgx version | ||
COPY --from=pkgxdev/pkgx:busybox /usr/local/bin/pkgx /usr/local/bin/pkgx | ||
COPY --chmod=+x <<EOF /usr/local/bin/licensed | ||
#!/usr/bin/env -S pkgx --shebang --quiet +github.com/licensee/licensed@5 -- licensed | ||
EOF | ||
RUN licensed --version | ||
|
||
# Environment variables | ||
ENV PUPPETEER_SKIP_DOWNLOAD="true" | ||
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/google-chrome-stable" | ||
|
||
# Copy repository | ||
COPY . /metrics | ||
WORKDIR /metrics | ||
COPY . . | ||
|
||
# Setup | ||
RUN chmod +x /metrics/source/app/action/index.mjs \ | ||
# Install latest chrome dev package, fonts to support major charsets and skip chromium download on puppeteer install | ||
# Based on https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker | ||
&& apt-get update \ | ||
&& apt-get install -y wget gnupg ca-certificates libgconf-2-4 \ | ||
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | ||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | ||
&& apt-get update \ | ||
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 libx11-xcb1 libxtst6 lsb-release --no-install-recommends \ | ||
# Install deno for miscellaneous scripts | ||
&& apt-get install -y curl unzip \ | ||
&& curl -fsSL https://deno.land/x/install/install.sh | DENO_INSTALL=/usr/local sh \ | ||
# Install ruby to support github licensed gem | ||
&& apt-get install -y ruby-full git g++ cmake pkg-config libssl-dev \ | ||
&& gem install licensed \ | ||
# Install python for node-gyp | ||
&& apt-get install -y python3 \ | ||
# Clean apt/lists | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
# Install node modules and rebuild indexes | ||
# Install node modules and rebuild indexes | ||
RUN set -x \ | ||
&& which "${PUPPETEER_EXECUTABLE_PATH}" \ | ||
&& npm ci \ | ||
&& npm run build | ||
|
||
# Environment variables | ||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | ||
ENV PUPPETEER_BROWSER_PATH "google-chrome-stable" | ||
&& npm run build \ | ||
&& npm prune --omit=dev | ||
|
||
# Execute GitHub action | ||
ENTRYPOINT node /metrics/source/app/action/index.mjs | ||
ENTRYPOINT ["node", "/metrics/source/app/action/index.mjs"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.