forked from stripe/smokescreen
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): docker image #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,32 @@ | ||
| name: build-and-push-docker-images | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: ["master"] | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2 | ||
| - name: Login to the GitHub container registry | ||
| uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Build and push | ||
| uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 # v4 | ||
| with: | ||
| push: true | ||
| tags: ghcr.io/tryriot/smokescreen:latest |
This file contains hidden or 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,52 @@ | ||
| # Build stage | ||
| FROM golang:1.25-trixie AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy Go module files | ||
| COPY go.mod go.sum ./ | ||
|
|
||
| RUN go mod download | ||
|
|
||
| COPY . . | ||
|
|
||
| RUN go build -o smokescreen main.go | ||
|
|
||
| # Runtime stage | ||
| FROM debian:trixie-slim | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy binary from builder stage | ||
| COPY --from=builder /app/smokescreen ./ | ||
|
|
||
| ARG DD_API_KEY=replace_with_your_api_key_if_needed | ||
| ENV DD_API_KEY=${DD_API_KEY} | ||
| ENV DD_AGENT_MAJOR_VERSION=7 | ||
| ENV DD_INSTALL_ONLY=true | ||
|
|
||
| RUN apt-get update && apt-get install -y curl bash && \ | ||
| bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)" && \ | ||
| apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| ENV DD_SITE=datadoghq.eu | ||
| ENV DD_LOGS_ENABLED=true | ||
| ENV DD_SERVICE=smokescreen | ||
| ENV DD_VERSION=1.0.0 | ||
| ENV DD_ENV=production | ||
| ENV DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true | ||
|
|
||
| EXPOSE 4750 | ||
|
|
||
| ENV DD_HOSTNAME=smokescreen-container | ||
|
|
||
| RUN echo '#!/bin/bash' > /start.sh && \ | ||
| echo 'export DD_HOSTNAME=${DD_HOSTNAME:-$(hostname)}' >> /start.sh && \ | ||
| echo '/opt/datadog-agent/bin/agent/agent run > /dev/null 2>&1 &' >> /start.sh && \ | ||
| echo 'sleep 2' >> /start.sh && \ | ||
| echo 'exec ./smokescreen --statsd-address localhost:8125 ' >> /start.sh && \ | ||
| chmod +x /start.sh | ||
|
|
||
| CMD ["/start.sh"] | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to put this env var despite docker warnings since DD made it mandatory