forked from nalbury/promql-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from chaosnative/sync-upstream
Sync the upstream changes for auth and tls
- Loading branch information
Showing
11 changed files
with
214 additions
and
65 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,31 @@ | ||
{ | ||
"name": "PromQL CLI Dev", | ||
"dockerComposeFile": "../docker-compose.dev.yml", | ||
"service": "promql", | ||
"workspaceFolder": "/promql-cli/", | ||
"remoteUser": "promql", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"configureZshAsDefaultShell": true, | ||
"username": "promql" | ||
}, | ||
"ghcr.io/devcontainers/features/git:1": {}, | ||
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {}, | ||
"ghcr.io/devcontainers/features/go:1": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"golang.go", | ||
"ms-azuretools.vscode-docker", | ||
"Gruntfuggly.todo-tree" | ||
], | ||
"settings": { | ||
"go.toolsManagement.autoUpdate": true, | ||
"go.useLanguageServer": true, | ||
"go.gopath": "/go" | ||
} | ||
} | ||
} | ||
} |
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
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,4 +1,3 @@ | ||
*.swp | ||
build/* | ||
.idea/ | ||
.devcontainer/ |
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,29 +1,15 @@ | ||
FROM golang:1.18-buster AS build | ||
|
||
ADD go.mod /promql-cli/go.mod | ||
ADD go.sum /promql-cli/go.sum | ||
COPY go.mod /promql-cli/go.mod | ||
COPY go.sum /promql-cli/go.sum | ||
|
||
WORKDIR /promql-cli/ | ||
RUN go mod download | ||
|
||
RUN apt-get update && apt-get install -y make | ||
|
||
ADD ./ /promql-cli/ | ||
COPY ./ /promql-cli/ | ||
ARG TARGETARCH | ||
RUN OS=linux ARCH=${TARGETARCH} INSTALL_PATH=/promql-cli/build/bin/ make install | ||
|
||
# TODO explore other base images here. | ||
# Requirements: | ||
# - small | ||
# - correct perms available for mounting and using a config file (config > cmdline flags), right now we just run as root... (see below) | ||
# I'm generally not a fan of alpine/busybox for a cmdline env but maybe minideb or similar? | ||
# Stock deb slim is pretty rad already :) | ||
FROM debian:buster-slim AS promql-cli | ||
COPY --from=build /promql-cli/build/bin/promql /bin/promql | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# TODO don't run as root... | ||
ENTRYPOINT [ "/bin/promql" ] | ||
FROM gcr.io/distroless/base-debian11:nonroot AS promql-cli | ||
COPY --from=build /promql-cli/build/bin/promql /promql | ||
ENTRYPOINT [ "/promql" ] |
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
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
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
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,13 @@ | ||
version: '3.8' | ||
services: | ||
promql: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: build | ||
volumes: | ||
- "./:/promql-cli/" | ||
command: sleep infinity | ||
network_mode: service:prometheus | ||
prometheus: | ||
image: prom/prometheus:latest |
Oops, something went wrong.