-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docker): adding in docker image building
- Loading branch information
Showing
4 changed files
with
37 additions
and
10 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,29 @@ | ||
name: Docker Images | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
schedule: # Rebuild images nightly | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
otel: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build Base | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: ${{ github.ref == 'refs/heads/main' && true || false}} | ||
platforms: linux/amd64,linux/arm64 | ||
tags: pocket/opentelemetry-collector-contrib | ||
context: "{{defaultContext}}:images/otel" |
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 |
---|---|---|
@@ -1,14 +1,17 @@ | ||
FROM alpine:latest | ||
# Use an alpine image as our base image, this allows us to define our own entry point script and have access to sh or bash, which the otel image does not have | ||
FROM alpine:3 | ||
|
||
COPY --from=otel/opentelemetry-collector-contrib:latest /otelcol-contrib /otelcol-contrib | ||
# Copy the otelcol-contrib binary from the official image | ||
COPY --from=otel/opentelemetry-collector-contrib:0.111.0 /otelcol-contrib /otelcol-contrib | ||
|
||
COPY otel-collector-config.yaml /etc/otelcol-contrib/config.yaml | ||
COPY entrypont.sh /entrypont.sh | ||
RUN chmod a+x /entrypont.sh | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod a+x /entrypoint.sh | ||
|
||
#Set the ENV variable for the google credentials that will be used by the google cloud exporter and mounted via an environment variable that will be saved to this file via our entrypoint script | ||
ENV GOOGLE_APPLICATION_CREDENTIALS=/etc/otelcol-contrib/key.json | ||
WORKDIR / | ||
|
||
ENTRYPOINT [ "./entrypont.sh" ] | ||
ENTRYPOINT [ "./entrypoint.sh" ] | ||
|
||
CMD [ "/otelcol-contrib", "--config", "/etc/otelcol-contrib/config.yaml" ] |
File renamed without changes.
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