Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: docker

on:
# publish on releases, e.g. v2.1.13 (image tagged as "2.1.13" - "v" prefix is removed)
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: macbre/push-to-ghcr@master
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to admit I haven't used this one before, but it looked simple enough. It should work with the standard GITHUB_TOKEN that github provides. So no need to setup anything.

with:
image_name: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ RUN mkdir /data && cp /build/deploy/cortex-tenant.yml /data/cortex-tenant.yml

FROM scratch

ENV CONFIG_FILE /data/cortex-tenant.yml
COPY --chown=65534:0 --from=builder /dist /

COPY --chown=65534:0 --from=builder /data /data
Expand All @@ -35,4 +34,4 @@ WORKDIR /data

COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/cortex-tenant"]
CMD ["-config", "$CONFIG_FILE"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this never worked. It's not supported in CMD. I figured (and of course I can change it) that it's easier to just override it with a mount or with a custom image.

CMD ["-config", "/data/cortex-tenant.yml"]
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,19 @@ If you want `deb` or `rpm` packages then install [FPM](https://fpm.readthedocs.i

## Containerization

To use the current container you need to overwrite the default configuration file. The Docker file uses a environment called `CONFIG_FILE` with the following value: `ENV CONFIG_FILE cortex-tenant.yml`.
This file get written to the workdir `/data`.
To use the current container you need to overwrite the default configuration file, mount your configuration into to `/data/cortex-tenant.yml`.

You can overwrite the default config by starting the container with
You can overwrite the default config by starting the container with:

```bash
docker container run \
-v <CONFIG_LOCATION>:/data/cortex-tenant.yml \
vincentfree/cortex-tenant:1.3.3
ghcr.io/blind-oracle/cortex-tenant:1.6.1
```

You can also write it to your prefered location and update the environment variable like this
... or build your own Docker image:

```bash
docker container run \
-e CONFIG_FILE=/data/config.yml \
-v <CONFIG_LOCATION>:/data/config.yml \
vincentfree/cortex-tenant:1.3.3
```Dockerfile
FROM ghcr.io/blind-oracle/cortex-tenant:1.6.1
ADD my-config.yml /data/cortex-tenant.yml
```