-
Notifications
You must be signed in to change notification settings - Fork 0
Use dynamic folder #1
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 17 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
6bbbf12
Update volume path in docker-compose.yml to use ${PWD} for better por…
johlju 4322dbd
Add contributing guidelines to CONTRIBUTING.md
johlju d998f6d
Add "passwordless" to ignoreWords in cspell configuration
johlju 1b1995f
Refactor README.md to improve clarity and structure of development en…
johlju 735de45
Update README.md description for clarity and add "Dockerized" to cspe…
johlju 39bb531
Fix volume path syntax in docker-compose.yml for consistency
johlju d7d50ab
Fix typo in CONTRIBUTING.md for clarity in Docker usage instructions
johlju de991c1
Fix typo in README.md for OpenSSH Client
johlju 22f0f20
Add note about directory mounting in Quick Start section of README.md
johlju 8f92cfd
Update CONTRIBUTING.md to add publishing instructions for Docker Hub …
johlju a639bac
Add additional words to ignore in cspell configuration
johlju 7ac2e9e
Add GitHub Actions workflow for publishing Docker images
johlju 21cee64
Simplify Zsh & Oh My Zsh description in README.md and clarify reposit…
johlju 3e85b53
Add platforms specification for Docker build and push action
johlju a354efb
Update Docker actions to latest versions in workflow
johlju 4f3264b
Normalize casing of ignored words in cspell configuration
johlju efa92aa
Fix typos in CONTRIBUTING.md for clarity and consistency
johlju 327bdcb
Add conditional directory change to .zshrc for ~/work
johlju 3685f7e
Add instructions for pulling and running the Docker image in README.md
johlju 0705d2a
Reorganize README.md to clarify Docker usage and repository cloning i…
johlju c49420f
Update README.md to use 'docker compose' instead of 'docker-compose' …
johlju 212423c
Update CONTRIBUTING.md to use 'docker compose' instead of 'docker-com…
johlju 073bf54
Fix casing for 'meslo' in cspell.json and add 'buildcache' to ignoreW…
johlju 71c1d6c
Add cache-to option for Docker build to optimize image publishing
johlju 01c9f45
Fix indentation for buildx step and ensure proper cache-to configurat…
johlju 3dfcea0
Fix formatting for cache-from and cache-to options in Docker publish …
johlju 293207e
Add provenance option to Docker build for enhanced image traceability
johlju f8ab2da
Remove cache-from and cache-to options from Docker build configuration
johlju b1f6515
Add cache-from and cache-to options for Docker build to enhance cachi…
johlju 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,50 @@ | ||
| name: Publish Docker Images | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*.*.*' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: docker.io | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Log in to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and Push Images | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
|
johlju marked this conversation as resolved.
johlju marked this conversation as resolved.
|
||
| tags: | | ||
| docker.io/viscalyx/devshell-dsc:${{ github.ref_name }} | ||
| docker.io/viscalyx/devshell-dsc:latest | ||
| ghcr.io/viscalyx/devshell-dsc:${{ github.ref_name }} | ||
| ghcr.io/viscalyx/devshell-dsc:latest | ||
|
johlju marked this conversation as resolved.
|
||
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,132 @@ | ||
| # Contributing to devshell-dsc | ||
|
|
||
| Thank you for your interest in contributing to **devshell-dsc**! This guide explains how to test, run, and rebuild the development shell locally. | ||
|
|
||
| For any additional contributions, bug reports, or feature requests, please open an issue or pull request on the GitHub repository. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Docker installed on your system. | ||
|
|
||
| ## Running and Testing the DevShell Container | ||
|
|
||
| To launch the development shell, run the following command in your terminal: | ||
|
|
||
| ### Using Docker | ||
|
|
||
| To launch the container and log in as _root_: | ||
|
|
||
| ```sh | ||
| docker run --rm -it devshell:dsc | ||
| ``` | ||
|
|
||
| ### Using Docker Compose | ||
|
|
||
| To launch the container as **developer** with your current folder mounted at `/home/developer/work`: | ||
|
|
||
| ```sh | ||
| docker-compose run --rm dev | ||
| ``` | ||
|
|
||
|
johlju marked this conversation as resolved.
|
||
| ## Rebuilding the Container | ||
|
|
||
| ### Docker | ||
|
|
||
| ```sh | ||
| docker build -t devshell:dsc . | ||
| ``` | ||
|
|
||
| ### Docker Compose | ||
|
|
||
| ```sh | ||
| docker-compose build dev | ||
| ``` | ||
|
|
||
| ### Docker (No Cache) | ||
|
|
||
| ```sh | ||
| docker build --no-cache -t devshell:dsc . | ||
| ``` | ||
|
|
||
| ### Docker Compose (No Cache) | ||
|
|
||
| ```sh | ||
| docker-compose build --no-cache dev | ||
| ``` | ||
|
|
||
| ## Publishing | ||
|
|
||
| Publishing happens automatically when a GitHub release tag using semantic versioning in the format `v1.0.0` is created. | ||
|
|
||
| ### Build | ||
|
|
||
| Build the `latest` tag: | ||
|
|
||
| ```sh | ||
| docker build -t viscalyx/devshell-dsc:latest . | ||
| ``` | ||
|
|
||
| ### Publish to Docker Hub | ||
|
|
||
| ```sh | ||
| op item get "<item>" --field password --reveal | docker login --username viscalyx --password-stdin | ||
| docker push viscalyx/devshell-dsc:latest | ||
| ``` | ||
|
|
||
| Logout from Docker Hub: | ||
|
|
||
| ```sh | ||
| docker logout | ||
| ``` | ||
|
|
||
| ### Publish to GitHub Container Registry | ||
|
|
||
| **Required GitHub Token permissions**: | ||
|
|
||
| - **Packages**: Read & write | ||
| - **Packages**: Delete package versions (optional) | ||
| - (If publishing to a private repo) **Repository**: Read & write | ||
|
|
||
| >[!IMPORTANT] | ||
| >Currently only GitHub classic Personal Access Token works, not fine-grained Personal Access Tokens. | ||
|
|
||
| Tag the image for GHCR: | ||
|
|
||
| ```sh | ||
| docker tag viscalyx/devshell-dsc:latest ghcr.io/viscalyx/devshell-dsc:latest | ||
| ``` | ||
|
|
||
| Login to GHCR and push: | ||
|
|
||
| ```sh | ||
| op item get "<item>" --field password --reveal | docker login ghcr.io -u viscalyxbot --password-stdin | ||
| docker push ghcr.io/viscalyx/devshell-dsc:latest | ||
|
johlju marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| Logout from GHCR: | ||
|
|
||
| ```sh | ||
| docker logout ghcr.io | ||
| ``` | ||
|
|
||
| ### Make GHCR Package Public | ||
|
|
||
| Once pushed, GHCR packages default to private. To switch to public: | ||
|
|
||
| - **Via GitHub UI**: Go to your GitHub account > Settings > Packages, select `devshell-dsc`, and change visibility to **Public**. | ||
|
|
||
| - **Via API** (classic PAT or GH_TOKEN with `packages:read` & `packages:write`): | ||
|
|
||
| ```sh | ||
| curl -X PUT \ | ||
| -H "Authorization: token $GITHUB_TOKEN" \ | ||
| -H "Accept: application/vnd.github.v3+json" \ | ||
| https://api.github.com/user/packages/container/devshell-dsc/visibility \ | ||
| -d '{"visibility":"public"}' | ||
| ``` | ||
|
|
||
| - **Via GitHub CLI**: | ||
|
|
||
| ```sh | ||
| gh api -X PUT /user/packages/container/devshell-dsc/visibility -F visibility=public | ||
| ``` | ||
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,83 +1,38 @@ | ||
| # devshell-dsc | ||
| # DevShell DSC Container | ||
|
|
||
| This repository provides a Docker-based development shell for working on your projects. | ||
| Dockerized Ubuntu 24.04 dev environment with Zsh (Oh My Zsh & Powerlevel10k), PowerShell & DSC v3 pre-configured for seamless developer workflows. | ||
|
johlju marked this conversation as resolved.
|
||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Docker installed on your system. | ||
|
|
||
| ## Starting the DevShell Container | ||
|
|
||
| To launch the development shell, run the following command in your terminal: | ||
|
|
||
| ### Zsh | ||
|
|
||
| ```sh | ||
| docker run --rm -it \ | ||
| -v "$HOME/projects:/work" \ | ||
| -w /work \ | ||
| --name devshell \ | ||
| devshell:dsc | ||
| ``` | ||
|
|
||
| ### PowerShell | ||
|
|
||
| ```powershell | ||
| docker run --rm -it ` | ||
| -v "${env:USERPROFILE}/projects:/work" ` | ||
| -w /work ` | ||
| --name devshell ` | ||
| devshell:dsc | ||
| ``` | ||
|
|
||
| This will: | ||
|
|
||
| - Mount your local `projects` directory into the container at `/work` using `-v "$HOME/projects:/work"`. | ||
| - Set the working directory inside the container to `/work` using `-w /work`. | ||
| - Remove the container after you exit using `--rm`. | ||
| - Run interactively with a TTY using `-it`. | ||
| ## Included Tools | ||
|
|
||
| Under the hood, each of these Docker flags configures the container runtime: | ||
| - PowerShell 7.5.2 & DSC v3 support | ||
| - .NET SDK 8.0 | ||
| - Git | ||
| - OpenSSH Client | ||
| - Configured non-root 'developer' user with passwordless sudo | ||
| - Zsh & Oh My Zsh | ||
| - Health check via PowerShell | ||
|
johlju marked this conversation as resolved.
|
||
|
|
||
| 1. `-v HOST_PATH:CONTAINER_PATH`: binds a host folder into the container filesystem. | ||
| 2. `-w WORKDIR`: defines the working directory inside the container. | ||
| 3. `--rm`: automatically removes the container when it stops. | ||
| 4. `-it`: allocates a pseudo-TTY and keeps STDIN open for interactive use. | ||
|
|
||
| You can now develop within the container environment seamlessly. | ||
|
|
||
| ## Using Docker Compose | ||
|
|
||
| To start an interactive shell using Docker Compose: | ||
|
|
||
| ```sh | ||
| docker-compose run --rm dev | ||
| ``` | ||
|
|
||
| This will build the image if needed and launch a Zsh session inside the `dev` service container. | ||
| ## Prerequisites | ||
|
|
||
| ## Rebuilding the Container | ||
| Ensure the following are installed on your host system: | ||
|
|
||
| ### Docker | ||
| - Docker (version >= 28.2) | ||
| - Docker Compose (version >= 2.36) | ||
|
|
||
| ```sh | ||
| docker build -t devshell:dsc . | ||
| ``` | ||
| ## Quick Start | ||
|
|
||
| ### Docker Compose | ||
| Launch an interactive development shell with your project directory mounted: | ||
|
|
||
| ```sh | ||
| docker-compose build dev | ||
| ``` | ||
| >[!NOTE] | ||
| >The container will mount the directory you run this command from to `/home/developer/work`. | ||
|
|
||
| ### Docker (No Cache) | ||
| ```bash | ||
| # Standard user | ||
| docker-compose -f "${HOME}/source/devshell-dsc/docker-compose.yml" run --rm dev | ||
|
|
||
| ```sh | ||
| docker build --no-cache -t devshell:dsc . | ||
| # Root user | ||
| docker-compose -f "${HOME}/source/devshell-dsc/docker-compose.yml" run --rm --user root dev | ||
| ``` | ||
|
|
||
| ### Docker Compose (No Cache) | ||
|
|
||
| ```sh | ||
| docker-compose build --no-cache dev | ||
| ``` | ||
| >[!IMPORTANT] | ||
| > Change the above path to where the repository was cloned. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.