Skip to content

Commit

Permalink
Add docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
skyoo2003 committed Feb 21, 2021
1 parent 785b6fa commit f48c0d1
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "skyoo2003"
assignees:
- "skyoo2003"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "skyoo2003"
assignees:
- "skyoo2003"
18 changes: 18 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint

on:
pull_request:
paths:
- '**/Dockerfile'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: hadolint
uses: reviewdog/action-hadolint@v1
with:
github_token: ${{ secrets.GH_PAT }}
reporter: github-pr-review
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Release"

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Get current tag name
id: tagName
uses: olegtarasov/[email protected]
with:
tagRegex: "(?<package>.+)-(?<version>((0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?))"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
- name: Build and push to Docker Registry
uses: docker/build-push-action@v2
with:
context: "${{ steps.tagName.outputs.package }}"
platforms: linux/amd64,linux/arm64,darwin
push: true
tags: |
ghcr.io/skyoo2003/${{ steps.tagName.outputs.package }}:latest
ghcr.io/skyoo2003/${{ steps.tagName.outputs.package }}:${{ steps.tagName.outputs.version }}
25 changes: 25 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Stale"

on:
schedule:
- cron: "0 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GH_PAT }}
stale-issue-message: >
This issue is stale because it has been open 30 days with no activity.
Remove stale label or comment or this will be closed in 5 days.
stale-pr-message: >
This pull request is stale because it has been open 30 days with no activity.
Remove stale label or comment or this will be closed in 5 days.
stale-issue-label: "stale"
exempt-issue-labels: "wip"
stale-pr-label: "stale"
exempt-pr-labels: "wip"
days-before-stale: 30
days-before-close: 5
6 changes: 6 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ignored:
- DL3018

trustedRegistries:
- docker.io
- docker.pkg.github.com
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-added-large-files
args:
- "--maxkb=10000"
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: detect-private-key
- id: mixed-line-ending
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.12
hooks:
- id: markdown-link-check
- repo: https://github.com/hadolint/hadolint
rev: v1.22.1
hooks:
- id: hadolint
1 change: 1 addition & 0 deletions digdag/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.md
31 changes: 31 additions & 0 deletions digdag/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM alpine:3.13
LABEL maintainer="Sung-Kyu Yoo <[email protected]>"

ENV DIGDAG_VERSION 0.10.0

USER 0

RUN set -e && \
addgroup --gid 1000 digdag && \
adduser --uid 1000 --ingroup digdag --home /digdag --disabled-password digdag && \
mkdir -p /digdag/config /digdag/bin && \
chown -R 1000:1000 /digdag

COPY digdag.properties /digdag/config/digdag.properties
COPY pip-requirements.txt /digdag/pip-requirements.txt
RUN set -e && \
apk update && \
apk add --no-cache --virtual .build-deps build-base gcc g++ glib-dev openssl-dev make && \
apk add --no-cache --virtual .exec-deps bash rsync curl git python3 python3-dev py3-pip openssh openjdk8-jre && \
pip3 install --no-cache-dir -r /digdag/pip-requirements.txt && \
rm -f /digdag/pip-requirements.txt && \
curl -o /digdag/bin/digdag.jar --create-dirs -L "https://dl.digdag.io/digdag-${DIGDAG_VERSION}" && \
chmod +x /digdag/bin/digdag.jar && \
apk del .build-deps

EXPOSE 65432
WORKDIR /digdag
USER 1000:1000

ENTRYPOINT [ "java", "-jar", "/digdag/bin/digdag.jar" ]
CMD [ "server", "--config", "/digdag/config/digdag.properties" ]
4 changes: 4 additions & 0 deletions digdag/digdag.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
server.bind=0.0.0.0
server.port=65432
database.type=h2
database.path=./db
Empty file added digdag/pip-requirements.txt
Empty file.
26 changes: 26 additions & 0 deletions prometheus-jmx-exporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:3.13
LABEL maintainer="Sung-Kyu Yoo <[email protected]>"

ENV JMX_EXPORTER_VERSION 0.15.0

USER 0

COPY config.yml /exporter/config/config.yml
RUN set -e && \
addgroup --gid 1000 exporter && \
adduser --uid 1000 --ingroup exporter --home /exporter --disabled-password exporter && \
mkdir -p /exporter/config /exporter/bin && \
chown -R 1000:1000 /exporter

RUN set -e && \
apk update && \
apk add --no-cache --virtual .exec-deps bash curl openjdk8-jre && \
curl -o /exporter/bin/jmx-prometheus-httpserver.jar --create-dirs -L "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_httpserver/${JMX_EXPORTER_VERSION}/jmx_prometheus_httpserver-${JMX_EXPORTER_VERSION}-jar-with-dependencies.jar" && \
chmod +x /exporter/bin/jmx-prometheus-httpserver.jar

EXPOSE 5556
WORKDIR /exporter
USER 1000:1000

ENTRYPOINT [ "java", "-jar", "/exporter/bin/jmx-prometheus-httpserver.jar" ]
CMD [ "5556", "/exporter/config/config.yml" ]
4 changes: 4 additions & 0 deletions prometheus-jmx-exporter/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
hostPort: 127.0.0.1:8999
ssl: false
rules:
- pattern: ".*"

0 comments on commit f48c0d1

Please sign in to comment.