Skip to content

Commit 363b9ca

Browse files
authored
feat: initial image (#1)
Signed-off-by: Aurora Gaffney <aurora@blinklabs.io>
1 parent ffcea37 commit 363b9ca

File tree

9 files changed

+191
-2
lines changed

9 files changed

+191
-2
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Blink Labs
2+
#
3+
* @blinklabs-io/core @blinklabs-io/ops
4+
*.md @blinklabs-io/core @blinklabs-io/docs @blinklabs-io/pms
5+
LICENSE @blinklabs-io/core @blinklabs-io/pms

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "docker"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"

.github/workflows/ci-docker.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Docker CI
2+
3+
on:
4+
pull_request:
5+
branches: ['main']
6+
paths: ['Dockerfile','.github/workflows/ci-docker.yml']
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: blinklabs-io/openvpn
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
docker:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: qemu
21+
uses: docker/setup-qemu-action@v3
22+
- uses: docker/setup-buildx-action@v3
23+
- id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
27+
- name: build
28+
uses: docker/build-push-action@v6
29+
with:
30+
context: .
31+
push: false
32+
platforms: linux/amd64,linux/arm64
33+
tags: ${{ steps.meta.outputs.tags }}
34+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# The below is pulled from upstream and slightly modified
2+
# https://github.com/webiny/action-conventional-commits/blob/master/README.md#usage
3+
4+
name: Conventional Commits
5+
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
name: Conventional Commits
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: webiny/action-conventional-commits@v1.3.0

.github/workflows/publish.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
tags:
7+
- 'v*.*.*'
8+
9+
concurrency: ${{ github.ref }}
10+
11+
jobs:
12+
build-and-push-image:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: qemu
20+
uses: docker/setup-qemu-action@v3
21+
- uses: docker/setup-buildx-action@v3
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
username: blinklabs
26+
password: ${{ secrets.DOCKER_PASSWORD }} # uses token
27+
- name: Login to GHCR
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: |
37+
blinklabs/openvpn
38+
ghcr.io/blinklabs-io/openvpn
39+
tags: |
40+
# version
41+
type=match,pattern=v(.*),group=1
42+
# branch
43+
type=ref,event=branch
44+
- name: push
45+
uses: docker/build-push-action@v6
46+
with:
47+
context: .
48+
push: true
49+
platforms: linux/amd64,linux/arm64
50+
tags: ${{ steps.meta.outputs.tags }}
51+
labels: ${{ steps.meta.outputs.labels }}
52+
# Update Docker Hub from README
53+
- name: Docker Hub Description
54+
uses: peter-evans/dockerhub-description@v4
55+
with:
56+
username: blinklabs
57+
password: ${{ secrets.DOCKER_PASSWORD }}
58+
repository: blinklabs/openvpn
59+
readme-filepath: ./README.md
60+
short-description: "Simple OpenVPN image"
61+
62+
github-release:
63+
runs-on: ubuntu-latest
64+
permissions:
65+
contents: write
66+
needs: [build-and-push-image]
67+
steps:
68+
- run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
69+
- uses: actions/github-script@v7
70+
if: startsWith(github.ref, 'refs/tags/')
71+
with:
72+
github-token: ${{ secrets.GITHUB_TOKEN }}
73+
script: |
74+
try {
75+
await github.rest.repos.createRelease({
76+
draft: false,
77+
generate_release_notes: true,
78+
name: process.env.RELEASE_TAG,
79+
owner: context.repo.owner,
80+
prerelease: false,
81+
repo: context.repo.repo,
82+
tag_name: process.env.RELEASE_TAG,
83+
});
84+
} catch (error) {
85+
core.setFailed(error.message);
86+
}

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ubuntu:24.04 AS base
2+
3+
COPY bin/ /usr/local/bin
4+
5+
RUN apt-get update \
6+
&& apt-get dist-upgrade -y \
7+
&& apt-get install -y openvpn \
8+
&& apt-get clean \
9+
&& rm -rf /var/lib/apt/lists/* \
10+
&& chmod +x /usr/local/bin/*
11+
12+
EXPOSE 1194/udp
13+
14+
ENTRYPOINT ["/usr/local/bin/entrypoint"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Blink Labs
3+
Copyright (c) 2025 Blink Labs Software
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# docker-openvpn
2-
OpenVPN Docker image
2+
3+
Simple OpenVPN image with updated version
4+
5+
## Using the image
6+
7+
There is no default config provided by the image, so you'll need to provide your own.
8+
9+
```
10+
docker run -d -n openvpn -v /path/to/openvpn.conf:/etc/openvpn/openvpn.conf ghcr.io/blinklabs-io/openvpn --config /etc/openvpn/openvpn.conf
11+
```

bin/entrypoint

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Create device for tun interfaces
4+
mkdir -p /dev/net
5+
if [ ! -c /dev/net/tun ]; then
6+
mknod /dev/net/tun c 10 200
7+
fi
8+
9+
openvpn --config /etc/openvpn/openvpn.conf $@

0 commit comments

Comments
 (0)