-
Notifications
You must be signed in to change notification settings - Fork 899
chore: experiment building dogfood image with nix #11680
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e9133f3
wip
matifali e6ec40f
wip
matifali 5c5fe7d
`make fmt && make gen`
matifali d06d741
set context as root for nix build
matifali 9535127
use correct dockerfile
matifali a1a6dfe
fixup!
matifali 13d5390
save
matifali 0792190
Update Dockerfile.nix
matifali 0e5f2e0
Update flake.nix
matifali e9c56b1
run on changes to flake
matifali 5c116ba
format and remove playwright
matifali d9ceed7
install playwright from `site/packages.json`
matifali 091399d
Merge branch 'main' into nix-dogfood
matifali 26a3257
fix typo
matifali 978745c
Merge branch 'main' into nix-dogfood
matifali 416c3ce
wip
matifali bdcbbf2
fixup!
matifali 1bf482a
optimize
matifali bcaea39
fixup!
matifali e250bd3
Merge branch 'main' into nix-dogfood
matifali 11e000a
fix statyp_script
matifali bd27006
fixup!
matifali ae9b07c
Update Dockerfile.nix
matifali 216460e
remove prettier and typescript
matifali 413d23c
`update flake`
matifali 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Ignore all files and folders | ||
** | ||
|
||
# Include flake.nix and flake.lock | ||
!flake.nix | ||
!flake.lock |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Build stage | ||
FROM nixos/nix:2.19.2 as nix | ||
|
||
# enable --experimental-features 'nix-command flakes' globally | ||
matifali marked this conversation as resolved.
Show resolved
Hide resolved
|
||
RUN mkdir -p /etc/nix && echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf | ||
|
||
# Copy the Nix related files into the Docker image | ||
COPY flake.nix /app/flake.nix | ||
COPY flake.lock /app/flake.lock | ||
|
||
# Install dependencies from flake and remove the flake | ||
RUN nix profile install /app#all --priority 4 && rm -rf /app | ||
matifali marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# print all users and groups | ||
RUN cp /etc/passwd /etc/passwd.nix && cp /etc/group /etc/group.nix | ||
|
||
# Final image | ||
FROM codercom/enterprise-base:latest as final | ||
|
||
USER root | ||
|
||
# Copy the Nix related files into the Docker image | ||
COPY --from=nix /nix /nix | ||
COPY --from=nix /etc/nix /etc/nix | ||
COPY --from=nix /root/.nix-profile /root/.nix-profile | ||
COPY --from=nix /root/.nix-defexpr /root/.nix-defexpr | ||
COPY --from=nix /root/.nix-channels /root/.nix-channels | ||
|
||
# Merge the passwd and group files | ||
COPY --from=nix /etc/passwd.nix /etc/passwd.nix | ||
COPY --from=nix /etc/group.nix /etc/group.nix | ||
RUN cat /etc/passwd.nix >> /etc/passwd && cat /etc/group.nix >> /etc/group && rm /etc/passwd.nix && rm /etc/group.nix | ||
|
||
# Update the PATH to include the Nix stuff | ||
ENV PATH=/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:$PATH | ||
|
||
# Install playwright dependencies, playwright deps need apt-get to be installed, thats why we install it here | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get upgrade -y && \ | ||
npm install -g pnpm playwright@1.36.2 && npx playwright install-deps && npm cache clean --force && \ | ||
matifali marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set environment variables | ||
ENV GOPRIVATE="coder.com,cdr.dev,go.coder.com,github.com/cdr,github.com/coder" | ||
|
||
# Increase memory allocation to NodeJS | ||
ENV NODE_OPTIONS="--max-old-space-size=8192" | ||
matifali marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
USER coder |
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
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 |
---|---|---|
|
@@ -54,6 +54,7 @@ | |
"matlab.svg", | ||
"memory.svg", | ||
"microsoft.svg", | ||
"nix.svg", | ||
"node.svg", | ||
"nodejs.svg", | ||
"nomad.svg", | ||
|
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.