diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..359274b --- /dev/null +++ b/.github/workflows/docker.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 65ef561..61daf09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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"] diff --git a/README.md b/README.md index 484204d..366f1b7 100644 --- a/README.md +++ b/README.md @@ -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 :/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 :/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 ```