Skip to content

Commit

Permalink
Merge pull request #50 from theohbrothers/change/remove-v-prefix-from…
Browse files Browse the repository at this point in the history
…-docker-tags

Change: Remove `v` prefix from docker tags
  • Loading branch information
leojonathanoh committed Sep 27, 2023
2 parents 419b466 + f75c923 commit c8b2d83
Show file tree
Hide file tree
Showing 52 changed files with 1,896 additions and 265 deletions.
480 changes: 240 additions & 240 deletions .github/workflows/ci-master-pr.yml

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ The base image is `alpine`.

| Tag | Dockerfile Build Context |
|:-------:|:---------:|
| `:v3.1.6`, `:latest` | [View](variants/v3.1.6) |
| `:v3.1.5` | [View](variants/v3.1.5) |
| `:v3.1.4` | [View](variants/v3.1.4) |
| `:v3.1.3` | [View](variants/v3.1.3) |
| `:v3.1.2` | [View](variants/v3.1.2) |
| `:v3.1.1` | [View](variants/v3.1.1) |
| `:v3.1.0` | [View](variants/v3.1.0) |
| `:v3.0.9` | [View](variants/v3.0.9) |
| `:v3.0.8` | [View](variants/v3.0.8) |
| `:v3.0.7` | [View](variants/v3.0.7) |
| `:v3.0.6` | [View](variants/v3.0.6) |
| `:v3.0.5` | [View](variants/v3.0.5) |
| `:v3.0.4` | [View](variants/v3.0.4) |
| `:v3.0.3` | [View](variants/v3.0.3) |
| `:v3.0.2` | [View](variants/v3.0.2) |
| `:v3.0.1` | [View](variants/v3.0.1) |
| `:3.1.6`, `:latest` | [View](variants/3.1.6) |
| `:3.1.5` | [View](variants/3.1.5) |
| `:3.1.4` | [View](variants/3.1.4) |
| `:3.1.3` | [View](variants/3.1.3) |
| `:3.1.2` | [View](variants/3.1.2) |
| `:3.1.1` | [View](variants/3.1.1) |
| `:3.1.0` | [View](variants/3.1.0) |
| `:3.0.9` | [View](variants/3.0.9) |
| `:3.0.8` | [View](variants/3.0.8) |
| `:3.0.7` | [View](variants/3.0.7) |
| `:3.0.6` | [View](variants/3.0.6) |
| `:3.0.5` | [View](variants/3.0.5) |
| `:3.0.4` | [View](variants/3.0.4) |
| `:3.0.3` | [View](variants/3.0.3) |
| `:3.0.2` | [View](variants/3.0.2) |
| `:3.0.1` | [View](variants/3.0.1) |

All images are based on Alpine.

Expand All @@ -37,14 +37,14 @@ In this image, the PKI will be stored in `/data/pki` (i.e. `EASYRSA_PKI=/data/pk

```sh
# Generate /data/pki
docker run --rm -it -v data:/data theohbrothers/docker-easyrsa:v3.1.6 init-pki
docker run --rm -it -v data:/data theohbrothers/docker-easyrsa:3.1.6 init-pki
# Generate CA, server and client certs
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:v3.1.6 build-ca nopass
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:v3.1.6 build-server-full server-01 nopass
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:v3.1.6 build-client-full client-01 nopass
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:3.1.6 build-ca nopass
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:3.1.6 build-server-full server-01 nopass
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:3.1.6 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:v3.1.6 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'
docker run --rm -it -e EASYRSA_BATCH=true -v data:/data theohbrothers/docker-easyrsa:3.1.6 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](https://github.com/OpenVPN/easy-rsa/blob/v3.0.0/doc/EasyRSA-Advanced.md#configuration-reference), there are four ways to run `easy-rsa`, namely:
Expand Down
3 changes: 1 addition & 2 deletions Update-Versions.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This script is to update versions in version.json, create PR(s) for each bumped version, merge PRs, and release
# This script is to update versions in versions.json, create PR(s) for each bumped version, merge PRs, and release
# It may be run manually or as a cron
# Use -WhatIf for dry run
[CmdletBinding(SupportsShouldProcess)]
Expand Down Expand Up @@ -53,4 +53,3 @@ try {
Pop-Location
}
}

4 changes: 2 additions & 2 deletions generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ $VARIANTS = @(
components = $subVariant['components']
job_group_key = $variant['package_version']
}
# Docker image tag. E.g. 'v3.0.0'
# Docker image tag. E.g. '3.0.0'
tag = @(
"v$( $variant['package_version'] )"
$variant['package_version']
$subVariant['components'] | ? { $_ }
# $variant['distro']
# $variant['distro_version']
Expand Down
46 changes: 46 additions & 0 deletions variants/3.0.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM alpine:3.17
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN apk add --no-cache ca-certificates

# Install easyrsa dependencies
RUN apk add --no-cache openssl

WORKDIR /data
ENV EASYRSA=/usr/share/easy-rsa
ENV EASYRSA_PKI=/data/pki

# Install easyrsa
# See: https://github.com/OpenVPN/easy-rsa/tree/master/release-keys
RUN set -eux; \
apk add --no-cache gnupg gpg-agent dirmngr; \
URL=https://github.com/OpenVPN/easy-rsa/releases/download/3.0.1/EasyRSA-3.0.1.tgz; \
FILE=$( basename $URL ); \
wget -q "$URL"; \
wget -q "$URL.sig"; \
gpg --keyserver keys.openpgp.org --recv-keys 6F4056821152F03B6B24F2FCF8489F839D7367F3; \
gpg --verify "$FILE.sig" "$FILE"; \
mkdir -p /usr/share/easy-rsa; \
tar -zxvf "$FILE" --strip-components=1 -C /usr/share/easy-rsa; \
ln -sf /usr/share/easy-rsa/easyrsa /usr/local/bin/easyrsa; \
\
easyrsa help; \
easyrsa init-pki; \
rm -rfv /data/pki; \
\
rm -fv ""; \
rm -fv ".sig"; \
apk del gnupg gpg-agent dirmngr; \
# Fix error: rm: can't remove '/root/.gnupg/S.gpg-agent.extra': No such file or directory
killall dirmngr; \
killall gpg-agent; \
rm -rf /root/.gnupg;

VOLUME /data

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]
40 changes: 40 additions & 0 deletions variants/3.0.1/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: '2.1'
services:
easyrsa:
container_name: easyrsa
image: theohbrothers/docker-easyrsa:3.0.1

# Uncomment and configure these environment to your needs. The following are the default values, according to: https://github.com/OpenVPN/easy-rsa/blob/v3.0.8/doc/EasyRSA-Advanced.md#configuration-reference
# Using environment variables is preferred to using a vars file
# Double dollar signs '$$' is to escape a dollar sign in the docker-compose yaml parser, see: https://stackoverflow.com/a/40621373
# environment:
# - EASYRSA_SSL_CONF=/etc/ssl/openssl.cnf
# - EASYRSA=$${0%/*}
# - EASYRSA_OPENSSL=openssl
# - EASYRSA_SSL_CONF=$$EASYRSA/openssl-easyrsa.cnf
# - EASYRSA_PKI=$$PWD/pki
# - EASYRSA_DN=cn_only
# - EASYRSA_REQ_COUNTRY=US
# - EASYRSA_REQ_PROVINCE=California
# - EASYRSA_REQ_CITY=San Francisco
# - EASYRSA_REQ_ORG=Copyleft Certificate Co
# - EASYRSA_REQ_EMAIL=me@example.net
# - EASYRSA_REQ_OU=My Organizational Unit
# - EASYRSA_KEY_SIZE=2048
# - EASYRSA_ALGO=rsa
# - EASYRSA_CURVE=secp384r1
# - EASYRSA_CA_EXPIRE=3650
# - EASYRSA_CERT_EXPIRE=180
# - EASYRSA_CERT_RENEW=30
# - EASYRSA_NS_SUPPORT=no
# - EASYRSA_NS_COMMENT=Easy-RSA Generated Certificate
# - EASYRSA_TEMP_FILE=$$EASYRSA_PKI/extensions.temp
# - EASYRSA_EXT_DIR=$$EASYRSA/x509-types
# - EASYRSA_REQ_CN=ChangeMe
# - EASYRSA_DIGEST=sha256
# - EASYRSA_BATCH=

# Uncomment this to mount your own openssl.cnf, vars file(s)
# volumes:
# - ./path/to/openssl.conf:/etc/ssl/openssl.cnf
# - ./path/to/vars:/etc/ssl/openssl.cnf
16 changes: 16 additions & 0 deletions variants/3.0.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
fi
else
exec "easyrsa" "$@"
fi

exec "$@"
46 changes: 46 additions & 0 deletions variants/3.0.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM alpine:3.17
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN apk add --no-cache ca-certificates

# Install easyrsa dependencies
RUN apk add --no-cache openssl

WORKDIR /data
ENV EASYRSA=/usr/share/easy-rsa
ENV EASYRSA_PKI=/data/pki

# Install easyrsa
# See: https://github.com/OpenVPN/easy-rsa/tree/master/release-keys
RUN set -eux; \
apk add --no-cache gnupg gpg-agent dirmngr; \
URL=https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.2/EasyRSA-3.0.2.tgz; \
FILE=$( basename $URL ); \
wget -q "$URL"; \
wget -q "$URL.sig"; \
gpg --keyserver keys.openpgp.org --recv-keys 6F4056821152F03B6B24F2FCF8489F839D7367F3; \
gpg --verify "$FILE.sig" "$FILE"; \
mkdir -p /usr/share/easy-rsa; \
tar -zxvf "$FILE" --strip-components=1 -C /usr/share/easy-rsa; \
ln -sf /usr/share/easy-rsa/easyrsa /usr/local/bin/easyrsa; \
\
easyrsa help; \
easyrsa init-pki; \
rm -rfv /data/pki; \
\
rm -fv ""; \
rm -fv ".sig"; \
apk del gnupg gpg-agent dirmngr; \
# Fix error: rm: can't remove '/root/.gnupg/S.gpg-agent.extra': No such file or directory
killall dirmngr; \
killall gpg-agent; \
rm -rf /root/.gnupg;

VOLUME /data

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]
40 changes: 40 additions & 0 deletions variants/3.0.2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: '2.1'
services:
easyrsa:
container_name: easyrsa
image: theohbrothers/docker-easyrsa:3.0.2

# Uncomment and configure these environment to your needs. The following are the default values, according to: https://github.com/OpenVPN/easy-rsa/blob/v3.0.8/doc/EasyRSA-Advanced.md#configuration-reference
# Using environment variables is preferred to using a vars file
# Double dollar signs '$$' is to escape a dollar sign in the docker-compose yaml parser, see: https://stackoverflow.com/a/40621373
# environment:
# - EASYRSA_SSL_CONF=/etc/ssl/openssl.cnf
# - EASYRSA=$${0%/*}
# - EASYRSA_OPENSSL=openssl
# - EASYRSA_SSL_CONF=$$EASYRSA/openssl-easyrsa.cnf
# - EASYRSA_PKI=$$PWD/pki
# - EASYRSA_DN=cn_only
# - EASYRSA_REQ_COUNTRY=US
# - EASYRSA_REQ_PROVINCE=California
# - EASYRSA_REQ_CITY=San Francisco
# - EASYRSA_REQ_ORG=Copyleft Certificate Co
# - EASYRSA_REQ_EMAIL=me@example.net
# - EASYRSA_REQ_OU=My Organizational Unit
# - EASYRSA_KEY_SIZE=2048
# - EASYRSA_ALGO=rsa
# - EASYRSA_CURVE=secp384r1
# - EASYRSA_CA_EXPIRE=3650
# - EASYRSA_CERT_EXPIRE=180
# - EASYRSA_CERT_RENEW=30
# - EASYRSA_NS_SUPPORT=no
# - EASYRSA_NS_COMMENT=Easy-RSA Generated Certificate
# - EASYRSA_TEMP_FILE=$$EASYRSA_PKI/extensions.temp
# - EASYRSA_EXT_DIR=$$EASYRSA/x509-types
# - EASYRSA_REQ_CN=ChangeMe
# - EASYRSA_DIGEST=sha256
# - EASYRSA_BATCH=

# Uncomment this to mount your own openssl.cnf, vars file(s)
# volumes:
# - ./path/to/openssl.conf:/etc/ssl/openssl.cnf
# - ./path/to/vars:/etc/ssl/openssl.cnf
16 changes: 16 additions & 0 deletions variants/3.0.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
fi
else
exec "easyrsa" "$@"
fi

exec "$@"
46 changes: 46 additions & 0 deletions variants/3.0.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM alpine:3.17
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN apk add --no-cache ca-certificates

# Install easyrsa dependencies
RUN apk add --no-cache openssl

WORKDIR /data
ENV EASYRSA=/usr/share/easy-rsa
ENV EASYRSA_PKI=/data/pki

# Install easyrsa
# See: https://github.com/OpenVPN/easy-rsa/tree/master/release-keys
RUN set -eux; \
apk add --no-cache gnupg gpg-agent dirmngr; \
URL=https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.3/EasyRSA-3.0.3.tgz; \
FILE=$( basename $URL ); \
wget -q "$URL"; \
wget -q "$URL.sig"; \
gpg --keyserver keys.openpgp.org --recv-keys 6F4056821152F03B6B24F2FCF8489F839D7367F3; \
gpg --verify "$FILE.sig" "$FILE"; \
mkdir -p /usr/share/easy-rsa; \
tar -zxvf "$FILE" --strip-components=1 -C /usr/share/easy-rsa; \
ln -sf /usr/share/easy-rsa/easyrsa /usr/local/bin/easyrsa; \
\
easyrsa help; \
easyrsa init-pki; \
rm -rfv /data/pki; \
\
rm -fv ""; \
rm -fv ".sig"; \
apk del gnupg gpg-agent dirmngr; \
# Fix error: rm: can't remove '/root/.gnupg/S.gpg-agent.extra': No such file or directory
killall dirmngr; \
killall gpg-agent; \
rm -rf /root/.gnupg;

VOLUME /data

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]
40 changes: 40 additions & 0 deletions variants/3.0.3/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: '2.1'
services:
easyrsa:
container_name: easyrsa
image: theohbrothers/docker-easyrsa:3.0.3

# Uncomment and configure these environment to your needs. The following are the default values, according to: https://github.com/OpenVPN/easy-rsa/blob/v3.0.8/doc/EasyRSA-Advanced.md#configuration-reference
# Using environment variables is preferred to using a vars file
# Double dollar signs '$$' is to escape a dollar sign in the docker-compose yaml parser, see: https://stackoverflow.com/a/40621373
# environment:
# - EASYRSA_SSL_CONF=/etc/ssl/openssl.cnf
# - EASYRSA=$${0%/*}
# - EASYRSA_OPENSSL=openssl
# - EASYRSA_SSL_CONF=$$EASYRSA/openssl-easyrsa.cnf
# - EASYRSA_PKI=$$PWD/pki
# - EASYRSA_DN=cn_only
# - EASYRSA_REQ_COUNTRY=US
# - EASYRSA_REQ_PROVINCE=California
# - EASYRSA_REQ_CITY=San Francisco
# - EASYRSA_REQ_ORG=Copyleft Certificate Co
# - EASYRSA_REQ_EMAIL=me@example.net
# - EASYRSA_REQ_OU=My Organizational Unit
# - EASYRSA_KEY_SIZE=2048
# - EASYRSA_ALGO=rsa
# - EASYRSA_CURVE=secp384r1
# - EASYRSA_CA_EXPIRE=3650
# - EASYRSA_CERT_EXPIRE=180
# - EASYRSA_CERT_RENEW=30
# - EASYRSA_NS_SUPPORT=no
# - EASYRSA_NS_COMMENT=Easy-RSA Generated Certificate
# - EASYRSA_TEMP_FILE=$$EASYRSA_PKI/extensions.temp
# - EASYRSA_EXT_DIR=$$EASYRSA/x509-types
# - EASYRSA_REQ_CN=ChangeMe
# - EASYRSA_DIGEST=sha256
# - EASYRSA_BATCH=

# Uncomment this to mount your own openssl.cnf, vars file(s)
# volumes:
# - ./path/to/openssl.conf:/etc/ssl/openssl.cnf
# - ./path/to/vars:/etc/ssl/openssl.cnf
16 changes: 16 additions & 0 deletions variants/3.0.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ]; then
# Get all subcommands. 'help' is also a subcommand
SUBCOMMANDS=$( easyrsa help | awk "/init-pki/,/^$/" | awk '{print $1}' | awk NF ; echo help )
if echo "$SUBCOMMANDS" | grep "^$1$"; then
set "easyrsa" "$@"
echo "Executing: $@"
exec "$@"
fi
else
exec "easyrsa" "$@"
fi

exec "$@"
Loading

0 comments on commit c8b2d83

Please sign in to comment.