-
Notifications
You must be signed in to change notification settings - Fork 887
feat: add git to Docker image #6034
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 all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dde5e95
feat: add git to Docker image
deansheather c334e5f
disable protections on github workflows for testing
deansheather f997a2f
fix workflow file
deansheather 5891361
update rcodesign
deansheather c68fbb1
fixup! update rcodesign
deansheather be1985a
fix workflow file
deansheather 94a2619
fixup! fix workflow file
deansheather c382c15
fixup! fix workflow file
deansheather d65f782
restore protections to workflow file
deansheather d56e27b
fixup! restore protections to workflow file
deansheather 8d22999
pr comments
deansheather 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,53 @@ | ||
name: docker-base | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- Dockerfile.base | ||
- Dockerfile | ||
|
||
schedule: | ||
# Run every week at 09:43 on Monday, Wednesday and Friday. We build this | ||
# frequently to ensure that packages are up-to-date. | ||
- cron: "43 9 * * 1,3,5" | ||
|
||
workflow_dispatch: | ||
|
||
# Avoid running multiple jobs for the same commit. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-docker-base | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'coder' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Docker login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create empty base-build-context directory | ||
run: mkdir base-build-context | ||
|
||
- name: Install depot.dev CLI | ||
uses: depot/setup-action@v1 | ||
|
||
# This uses OIDC authentication, so no auth variables are required. | ||
- name: Build base Docker image via depot.dev | ||
uses: depot/build-push-action@v1 | ||
with: | ||
project: wl5hnrrkns | ||
context: base-build-context | ||
file: Dockerfile.base | ||
pull: true | ||
no-cache: true | ||
push: true | ||
tags: | | ||
ghcr.io/coder/coder-base:latest |
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
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,27 @@ | ||
# This is the base image used for Coder images. It's a multi-arch image that is | ||
# built in depot.dev for all supported architectures. Since it's built on real | ||
# hardware and not cross-compiled, it can have "RUN" commands. | ||
FROM alpine:latest | ||
|
||
# We use a single RUN command to reduce the number of layers in the image. | ||
RUN apk add --no-cache \ | ||
curl \ | ||
wget \ | ||
bash \ | ||
git \ | ||
openssh-client && \ | ||
addgroup \ | ||
-g 1000 \ | ||
coder && \ | ||
adduser \ | ||
-D \ | ||
-s /bin/bash \ | ||
-h /home/coder \ | ||
-u 1000 \ | ||
-G coder \ | ||
coder | ||
|
||
USER 1000:1000 | ||
ENV HOME=/home/coder | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt | ||
WORKDIR /home/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
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.
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.
Why do we need a base? Can we do all builds in depot? then we don't need the forking logic.
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.
Because then every developer needs to have depot access and install depot CLI and authenticate it just to build docker images. The forking logic makes it easier overall as most people won't have to worry about dealing with the build process anyways.
I also don't think it adds that much overhead and it's clearly documented at the top of each Dockerfile what they're for.
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.
Makes sense!