From 7479c2dd283d4ecc808fc65107048658dde778a2 Mon Sep 17 00:00:00 2001 From: Armaan Tobaccowalla Date: Sun, 20 Mar 2022 15:14:59 -0400 Subject: [PATCH] [Docker] Add datadog agent image (#121) * Add datadog docker image * Fix --- .github/cdk/main.ts | 2 +- .../cdkactions_docker-datadog-agent.yaml | 33 +++++++++++++++++++ docker/datadog-agent/.dockerignore | 11 +++++++ docker/datadog-agent/Dockerfile | 6 ++++ docker/datadog-agent/LICENSE | 21 ++++++++++++ docker/datadog-agent/README.md | 9 +++++ 6 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cdkactions_docker-datadog-agent.yaml create mode 100644 docker/datadog-agent/.dockerignore create mode 100644 docker/datadog-agent/Dockerfile create mode 100644 docker/datadog-agent/LICENSE create mode 100644 docker/datadog-agent/README.md diff --git a/.github/cdk/main.ts b/.github/cdk/main.ts index d5241fa9..ad5435d9 100644 --- a/.github/cdk/main.ts +++ b/.github/cdk/main.ts @@ -37,7 +37,7 @@ new CDKPublishStack(app, 'kraken'); new CDKPublishStack(app, 'kittyhawk'); // Docker stacks -const dockerImages = ['django-base', 'pg-s3-backup', 'team-sync']; +const dockerImages = ['datadog-agent', 'django-base', 'pg-s3-backup', 'team-sync']; dockerImages.map(name => new DockerPublishStack(app, name)); new ShibbolethDockerStack(app); diff --git a/.github/workflows/cdkactions_docker-datadog-agent.yaml b/.github/workflows/cdkactions_docker-datadog-agent.yaml new file mode 100644 index 00000000..fa671fca --- /dev/null +++ b/.github/workflows/cdkactions_docker-datadog-agent.yaml @@ -0,0 +1,33 @@ +# Generated by cdkactions. Do not modify +# Generated as part of the 'datadog-agent' stack. +name: Publish datadog-agent +on: + push: + paths: + - docker/datadog-agent/** +jobs: + publish-datadog-agent: + name: Publish datadog-agent + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: buildx-publish-datadog-agent + - uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build/Publish + uses: docker/build-push-action@v2 + with: + context: docker/datadog-agent + file: docker/datadog-agent/Dockerfile + push: ${{ github.ref == 'refs/heads/master' }} + cache-from: type=local,src=/tmp/.buildx-cache,type=registry,ref=pennlabs/datadog-agent:latest + cache-to: type=local,dest=/tmp/.buildx-cache + tags: pennlabs/datadog-agent:latest,pennlabs/datadog-agent:${{ github.sha }} diff --git a/docker/datadog-agent/.dockerignore b/docker/datadog-agent/.dockerignore new file mode 100644 index 00000000..fd230a95 --- /dev/null +++ b/docker/datadog-agent/.dockerignore @@ -0,0 +1,11 @@ +# Docker +Dockerfile +.dockerignore + +# git +.github +.git +.gitignore +.gitmodules +**/*.md +LICENSE diff --git a/docker/datadog-agent/Dockerfile b/docker/datadog-agent/Dockerfile new file mode 100644 index 00000000..5bd7cf59 --- /dev/null +++ b/docker/datadog-agent/Dockerfile @@ -0,0 +1,6 @@ +FROM gcr.io/datadoghq/agent:7.34.0 + +LABEL maintainer="Penn Labs" + +RUN agent integration install -r -t datadog-cert_manager==2.2.0 +RUN agent integration install -r -t datadog-traefik==1.0.0 diff --git a/docker/datadog-agent/LICENSE b/docker/datadog-agent/LICENSE new file mode 100644 index 00000000..94dfe464 --- /dev/null +++ b/docker/datadog-agent/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Penn Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/docker/datadog-agent/README.md b/docker/datadog-agent/README.md new file mode 100644 index 00000000..bf922345 --- /dev/null +++ b/docker/datadog-agent/README.md @@ -0,0 +1,9 @@ +# datadog-agent + +[![Docker Pulls](https://img.shields.io/docker/pulls/pennlabs/datadog-agent)](https://hub.docker.com/r/pennlabs/django-base) + +This repository contains a datadog agent image that addionally installs extra integrations. + +## Features + +This docker image contains the cert-manager and traefik datadog integrations.