generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build mysqld-exporter container image. (#529)
* Build fluent-bit container image. Signed-off-by: d-kuro <kurosawa7620@gmail.com> * Remove BRANCH file Signed-off-by: d-kuro <kurosawa7620@gmail.com> * Build mysql-exporter container image. Signed-off-by: d-kuro <kurosawa7620@gmail.com> * Fix workflow Signed-off-by: d-kuro <kurosawa7620@gmail.com> * Fix container link Signed-off-by: d-kuro <kurosawa7620@gmail.com> * Use larger_runner_16core Signed-off-by: d-kuro <kurosawa7620@gmail.com> * Fix review feedback issues Signed-off-by: d-kuro <kurosawa7620@gmail.com> --------- Signed-off-by: d-kuro <kurosawa7620@gmail.com>
- Loading branch information
Showing
5 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "Build mysqld exporter container" | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "containers/mysqld_exporter/**" | ||
- ".github/workflows/build-mysqld-exporter-container.yaml" | ||
- "!**.md" | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- "containers/mysqld_exporter/**" | ||
- ".github/workflows/build-mysqld-exporter-container.yaml" | ||
- "!**.md" | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ vars.IMAGE_BUILD_RUNNER || 'ubuntu-20.04' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-qemu-action@v2 | ||
- uses: docker/setup-buildx-action@v2 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check TAG file | ||
working-directory: containers | ||
run: | | ||
result="$(./tag_exists moco/mysqld_exporter mysqld_exporter)" | ||
if [ "$result" = ok ]; then | ||
exit 1 | ||
fi | ||
echo "TAG=$(cat ./mysqld_exporter/TAG)" >> $GITHUB_ENV | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
context: containers/mysqld_exporter/. | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.ref == 'refs/heads/main' }} | ||
tags: ghcr.io/cybozu-go/moco/mysqld_exporter:${{ env.TAG }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# mysqld_exporter container | ||
|
||
# Stage1: build from source | ||
FROM quay.io/cybozu/golang:1.19-jammy AS build | ||
|
||
ARG MYSQLD_EXPORTER_VERSION=v0.14.0 | ||
|
||
RUN git clone -b ${MYSQLD_EXPORTER_VERSION} --depth 1 https://github.com/prometheus/mysqld_exporter \ | ||
&& make -C mysqld_exporter build | ||
|
||
# Stage2: setup runtime container | ||
FROM scratch | ||
|
||
COPY --from=build /work/mysqld_exporter/LICENSE /LICENSE | ||
COPY --from=build /work/mysqld_exporter/mysqld_exporter /mysqld_exporter | ||
|
||
USER 10000:10000 | ||
EXPOSE 9104 | ||
|
||
ENTRYPOINT ["/mysqld_exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# mysqld_exporter | ||
|
||
This directory provides a Dockerfile to build a Docker container that runs [mysqld_exporter](https://github.com/prometheus/mysqld_exporter). | ||
|
||
Docker images | ||
------------- | ||
|
||
Docker images are available on [ghcr.io](https://github.com/cybozu-go/moco/pkgs/container/moco/mysqld_exporter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.14.0.1 |