Skip to content

Commit

Permalink
Merge pull request #1335 from USEPA/EPAD8-2370-metrics-container-latest
Browse files Browse the repository at this point in the history
EPAD8-2370: Switch metrics container to Debian to bring in latest AWS CLI
  • Loading branch information
carsoncho authored Mar 4, 2024
2 parents a045c46 + 3ef4215 commit 568ae14
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 32 deletions.
17 changes: 2 additions & 15 deletions .buildkite/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,12 @@ steps:
concurrency_group: $BUILDKITE_PIPELINE_SLUG/build-$BUILDKITE_BRANCH
concurrency: 4

commands: docker build services/metrics

plugins:
- cultureamp/aws-assume-role#v0.1.0:
role: arn:aws:iam::316981092358:role/BuildkiteRoleForImageBuilds

- docker#v3.12.0:
image: gcr.io/kaniko-project/executor:debug
workdir: /workspace

propagate-aws-auth-tokens: true

entrypoint: /bin/sh
command:
- -ec
- |
echo '{"credsStore":"ecr-login"}' >/kaniko/.docker/config.json
/kaniko/executor \
--context=/workspace/services/metrics \
--no-push
# Perform a Terraform formatting check. See the terraform-fmt.sh script for more details
# on what is executed in this step.
- label: ":terraform: Formatting"
Expand Down
19 changes: 4 additions & 15 deletions .buildkite/webcms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,14 @@ steps:
concurrency_group: $BUILDKITE_PIPELINE_SLUG/build-$BUILDKITE_BRANCH
concurrency: 4

commands:
- docker build services/metrics --tag "${WEBCMS_REPO_URL}/webcms-${WEBCMS_ENVIRONMENT}-${WEBCMS_SITE}-fpm-metrics:${WEBCMS_IMAGE_TAG}"
- docker push "${WEBCMS_REPO_URL}/webcms-${WEBCMS_ENVIRONMENT}-${WEBCMS_SITE}-fpm-metrics:${WEBCMS_IMAGE_TAG}"

plugins:
- cultureamp/aws-assume-role#v0.1.0:
role: arn:aws:iam::316981092358:role/BuildkiteRoleForImageBuilds

- docker#v3.12.0:
image: gcr.io/kaniko-project/executor:debug
workdir: /workspace

propagate-aws-auth-tokens: true

entrypoint: /bin/sh
command:
- -ec
- |
echo '{"credsStore":"ecr-login"}' >/kaniko/.docker/config.json
/kaniko/executor \
--context=/workspace/services/metrics \
--destination="${WEBCMS_REPO_URL}/webcms-${WEBCMS_ENVIRONMENT}-${WEBCMS_SITE}-fpm-metrics:${WEBCMS_IMAGE_TAG}"
- wait: ~

- label: ":terraform: WebCMS (${WEBCMS_SITE}-en)"
Expand Down
23 changes: 21 additions & 2 deletions services/metrics/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
FROM alpine:latest
FROM debian:stable-slim

RUN apk add --no-cache aws-cli curl jq
RUN set -ex \
# 1. Install packages needed for this container
&& apt-get update \
&& apt-get install --yes --no-install-recommends \
ca-certificates \
curl \
jq \
unzip \
# 2. Download and install the latest AWS CLI
&& cd /tmp \
&& curl -fsSL https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip \
&& unzip awscliv2.zip \
&& ./aws/install \
# 3. Clean up the CLI installer files
&& rm -rf ./aws awscliv2.zip \
# 4. Remove unneeded packages by marking them as automatic and letting the
# 'autoremove' command do its thing
&& apt-mark auto unzip \
&& apt-get autoremove --purge --yes \
&& rm -rf /var/apt/lists/*

COPY transform.jq /etc/transform.jq
COPY entrypoint.sh /bin/entrypoint.sh
Expand Down

0 comments on commit 568ae14

Please sign in to comment.