Skip to content

Latest commit

 

History

History
104 lines (73 loc) · 4.23 KB

README.md

File metadata and controls

104 lines (73 loc) · 4.23 KB

docker-easyrsa

github-actions github-release docker-image-size

Dockerized easy-rsa.

The base image is alpine.

Tags

Tag Dockerfile Build Context
:3.2.0, :latest View
:3.1.7 View
:3.1.6 View
:3.1.5 View
:3.1.4 View
:3.1.3 View
:3.1.2 View
:3.1.1 View
:3.1.0 View
:3.0.9 View
:3.0.8 View
:3.0.7 View
:3.0.6 View
:3.0.5 View
:3.0.4 View
:3.0.3 View
:3.0.2 View
:3.0.1 View

All images are based on Alpine.

Usage

In this image, the PKI will be stored in /data/pki (i.e. EASYRSA_PKI=/data/pki, see Dockerfile).

# Generate /data/pki
docker run --rm -it -v data:/data theohbrothers/docker-easyrsa:3.2.0 init-pki
# Generate CA, server and client certs
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:3.2.0 build-ca nopass
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:3.2.0 build-server-full server-01 nopass
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:3.2.0 build-client-full client-01 nopass

# Alternatively, a nice one liner to do everything
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:3.2.0 sh -c 'set -e; easyrsa init-pki; easyrsa build-ca nopass; easyrsa build-server-full server-01 nopass; easyrsa build-client-full client-01 nopass; find /data/pki'

According to easy-rsa documentation, there are four ways to run easy-rsa, namely:

  • Command-line options
  • Environment variables
  • vars file
  • Built-in defaults

Command line

See easy-rsa documentation on command line options and their matching environment variables here.

Environment variables

See easy-rsa documentation on environment variables here.

vars file

See easy-rsa documentation on using vars file here.

See an example of a vars file here.

Development

Requires Windows powershell or pwsh.

# Install Generate-DockerImageVariants module: https://github.com/theohbrothers/Generate-DockerImageVariants
Install-Module -Name Generate-DockerImageVariants -Repository PSGallery -Scope CurrentUser -Force -Verbose

# Edit ./generate templates

# Generate the variants
Generate-DockerImageVariants .

Variant versions

versions.json contains a list of Semver versions, one per line.

To update versions in versions.json:

./Update-Versions.ps1

To update versions in versions.json, and open a PR for each changed version, and merge successful PRs one after another (to prevent merge conflicts), and finally create a tagged release and close milestone:

$env:GITHUB_TOKEN = 'xxx'
./Update-Versions.ps1 -PR -AutoMergeQueue -AutoRelease

To perform a dry run, use -WhatIf.