Skip to content

An Alpine docker image powerful enough to run vscode remote containers or docker-based GitHub Actions

License

Notifications You must be signed in to change notification settings

raonigabriel/coder-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coder-core


This is my opinionated attempt to build a "lightweight" docker image powerful enough to run vscode remote containers or to be used as a base image to create docker container GitHub Actions.

The not-that-lightweight actually means that while ubuntu:latest 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, 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)
  6. Preinstalled node (v16.19.1) and npm (8.10.0) !!!
  7. Preinstalled tooling (git, curl, socat, openssh-client, nano, unzip, brotli, zstd, xz) !!!
  8. Image is hosted on GitHub 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)

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 for a full example on how to setup a remote container for development.


Licenses

Apache 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.