https://github.com/raonigabriel/coder-core
An Alpine docker image powerful enough to run vscode remote containers or docker-based GitHub Actions
https://github.com/raonigabriel/coder-core
alpine docker gha github-actions lightweight remote-containers
Last synced: 8 months ago
JSON representation
An Alpine docker image powerful enough to run vscode remote containers or docker-based GitHub Actions
- Host: GitHub
- URL: https://github.com/raonigabriel/coder-core
- Owner: raonigabriel
- License: apache-2.0
- Created: 2022-09-05T20:46:25.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-10T03:43:25.000Z (over 1 year ago)
- Last Synced: 2025-01-10T04:28:29.158Z (over 1 year ago)
- Topics: alpine, docker, gha, github-actions, lightweight, remote-containers
- Language: Dockerfile
- Homepage:
- Size: 48.8 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# coder-core
---
This is my opinionated attempt to build a "lightweight" docker image powerful enough to run [vscode remote containers](https://code.visualstudio.com/docs/remote/containers-tutorial) or to be used as a base image to create [docker container GitHub Actions](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action).
The **not-that-lightweight** actually means that while [ubuntu:latest](https://hub.docker.com/_/ubuntu) is ~78MB, this image is ~90MB. Yes, this translates to **extra 12MB** compared to ubuntu, but the preinstalled tools are **by far** more comprehensive (see bellow).
# Features
1. Based on Alpine instead of Ubuntu. This translates to [musl being used instead of glib](https://wiki.musl-libc.org/functional-differences-from-glibc.html), but compatibility libraries are also preinstalled.
2. Its is Alpine, but using **bash** instead of **ash**.
3. By using **tini**, we ensure that child processes are correctly reaped.
4. Default user **coder** and group **coder** using UID and GID = 1000, to ease volume-mapping permissions issues.
5. Passwordless, **sudo** support: easily install extra packages with apk (e.g, ```sudo apk add docker-cli jq```)
7. Preinstalled node (v16.19.1) and npm (8.10.0) !!!
8. Preinstalled tooling (git, curl, socat, openssh-client, nano, unzip, brotli, zstd, xz) !!!
9. Image is hosted on [GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry), hence we get fast pulls whenever using this image with GitHub Actions.
# Guidelines that I follow
- Whenever possible, install software directly from the Alpine repositories, i.e. use apk instead of downloading / manually installing them.
- Keep it small: do not cross the 100MB image size boundary.
- Multi arch (amd64 && arm64)
# Usage
```
# docker run -it ghcr.io/raonigabriel/coder-core:latest
coder@65dc49a66e7c:~$
```
## Creating your own derived image (Java example)
```Dockerfile
FROM ghcr.io/raonigabriel/coder-core:latest
# Installing Java and tools
RUN sudo apk --no-cache add maven gradle
# Setup env variables
ENV JAVA_HOME=/usr/lib/jvm/default-jvm \
MAVEN_HOME=/usr/share/java/maven-3 \
GRADLE_HOME=/usr/share/java/gradle
```
See my [spring-qrcode-example](https://github.com/raonigabriel/spring-qrcode-example/tree/master/.devcontainer) for a full example on how to [setup a remote container](https://code.visualstudio.com/docs/remote/create-dev-container) for development.
---
## Licenses
[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
---
## Disclaimer
* This code comes with no warranty. Use it at your own risk.
* I don't like Apple. Fuck off, fan-boys.
* I don't like left-winged snowflakes. Fuck off, code-covenant.
* I will call my branches the old way. Long live **master**, fuck-off renaming.