Skip to content
Merged
Show file tree
Hide file tree
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 Jul 17, 2025
4322dbd
Add contributing guidelines to CONTRIBUTING.md
johlju Jul 17, 2025
d998f6d
Add "passwordless" to ignoreWords in cspell configuration
johlju Jul 17, 2025
1b1995f
Refactor README.md to improve clarity and structure of development en…
johlju Jul 17, 2025
735de45
Update README.md description for clarity and add "Dockerized" to cspe…
johlju Jul 17, 2025
39bb531
Fix volume path syntax in docker-compose.yml for consistency
johlju Jul 17, 2025
d7d50ab
Fix typo in CONTRIBUTING.md for clarity in Docker usage instructions
johlju Jul 17, 2025
de991c1
Fix typo in README.md for OpenSSH Client
johlju Jul 17, 2025
22f0f20
Add note about directory mounting in Quick Start section of README.md
johlju Jul 17, 2025
8f92cfd
Update CONTRIBUTING.md to add publishing instructions for Docker Hub …
johlju Jul 17, 2025
a639bac
Add additional words to ignore in cspell configuration
johlju Jul 17, 2025
7ac2e9e
Add GitHub Actions workflow for publishing Docker images
johlju Jul 17, 2025
21cee64
Simplify Zsh & Oh My Zsh description in README.md and clarify reposit…
johlju Jul 17, 2025
3e85b53
Add platforms specification for Docker build and push action
johlju Jul 17, 2025
a354efb
Update Docker actions to latest versions in workflow
johlju Jul 17, 2025
4f3264b
Normalize casing of ignored words in cspell configuration
johlju Jul 17, 2025
efa92aa
Fix typos in CONTRIBUTING.md for clarity and consistency
johlju Jul 17, 2025
327bdcb
Add conditional directory change to .zshrc for ~/work
johlju Jul 17, 2025
3685f7e
Add instructions for pulling and running the Docker image in README.md
johlju Jul 17, 2025
0705d2a
Reorganize README.md to clarify Docker usage and repository cloning i…
johlju Jul 17, 2025
c49420f
Update README.md to use 'docker compose' instead of 'docker-compose' …
johlju Jul 17, 2025
212423c
Update CONTRIBUTING.md to use 'docker compose' instead of 'docker-com…
johlju Jul 17, 2025
073bf54
Fix casing for 'meslo' in cspell.json and add 'buildcache' to ignoreW…
johlju Jul 17, 2025
71c1d6c
Add cache-to option for Docker build to optimize image publishing
johlju Jul 17, 2025
01c9f45
Fix indentation for buildx step and ensure proper cache-to configurat…
johlju Jul 17, 2025
3dfcea0
Fix formatting for cache-from and cache-to options in Docker publish …
johlju Jul 17, 2025
293207e
Add provenance option to Docker build for enhanced image traceability
johlju Jul 17, 2025
f8ab2da
Remove cache-from and cache-to options from Docker build configuration
johlju Jul 17, 2025
b1f6515
Add cache-from and cache-to options for Docker build to enhance cachi…
johlju Jul 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/docker-publish.yml
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
Comment thread
johlju marked this conversation as resolved.
Comment thread
johlju marked this conversation as resolved.
Comment thread
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
Comment thread
johlju marked this conversation as resolved.
132 changes: 132 additions & 0 deletions CONTRIBUTING.md
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
```

Comment thread
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
Comment thread
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
```
95 changes: 25 additions & 70 deletions README.md
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.
Comment thread
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
Comment thread
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.
10 changes: 8 additions & 2 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
"ignoreWords": [
"noninteractive",
"chsh",
"PSDSC",
"psdsc",
"dpkg",
"elif",
"devshell",
"fontconfig",
"powerline",
"powerlevel",
"Meslo"
"Meslo",
Comment thread
johlju marked this conversation as resolved.
Outdated
"passwordless",
"dockerized",
"dockerhub",
"buildx",
"viscalyx",
"viscalyxbot"
]
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
build: .
user: developer
volumes:
- .:/home/developer/work
- "${PWD}:/home/developer/work"
working_dir: /home/developer/work
Comment thread
johlju marked this conversation as resolved.
entrypoint: zsh
stdin_open: true
Expand Down