Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci/container): Statically linked fqd container #64

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/build-push-container-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Push Image
on:
push:
tags:
- '*'

env:
# TODO: change this to the actual registry
IMAGE_NAME: "us-central1-docker.pkg.dev/circonus.com/circonus/fq-images/fqd"

jobs:
build:
name: Build and push image
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: latest ${{ github.ref_name }} ${{ github.sha }}
containerfiles: |
./Dockerfile

- name: Push To registry
id: push-to-registry
uses: redhat-actions/push-to-registry@v2
with:
tags: ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:${{ github.ref_name }} ${{ env.IMAGE_NAME }}:${{ github.sha }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
7 changes: 7 additions & 0 deletions Circonus.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Circonus]
name=Circonus CentOS 7 Pilot repo
baseurl=https://updates.circonus.net/centos/7/x86_64/
enabled=1
fastestmirror_enabled=0
gpgcheck=1
metadata_expire=1m
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM centos:centos7.9.2009 AS centos

RUN useradd -u 65534 nobody

RUN yum -y install gcc make

RUN yum -y install sqlite
COPY Circonus.repo /etc/yum.repos.d/
RUN rpm --import https://keybase.io/circonuspkg/pgp_keys.asc?fingerprint=14ff6826503494d85e62d2f22dd15eba6d4fa648
RUN yum -y install circonus-platform-library-bcd circonus-platform-library-jlog circonus-platform-library-liblz4 circonus-platform-library-uuid circonus-platform-runtime-luajit

WORKDIR /src/fq
COPY . ./
RUN LDFLAGS="-static -static-libgcc -static-libstdc++" make

FROM scratch
USER nobody
WORKDIR /
COPY --from=centos /etc/passwd /etc/passwd
COPY --from=centos /src/fq/fqd /fqd
ENTRYPOINT ["/fqd"]
CMD ["-D"]