Skip to content

Commit

Permalink
Merge pull request #13 from hostwithquantum/docker-build
Browse files Browse the repository at this point in the history
Docker build + Dockerfile fixes
  • Loading branch information
blind-oracle committed Mar 31, 2022
2 parents a74e7e5 + 0310e41 commit 5e5ae40
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
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
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"]
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
```

0 comments on commit 5e5ae40

Please sign in to comment.