Skip to content

Commit

Permalink
Merge pull request #1 from emqx/0711-build-docker-image
Browse files Browse the repository at this point in the history
feat: add Dockerfile and workflow to build docker image
  • Loading branch information
id authored Jul 11, 2023
2 parents 0ac90f4 + 3e8cd96 commit 3dfc0db
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: docker

on: [push]

jobs:
docker:
strategy:
matrix:
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ github.repository }}
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM clojure:latest

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY . /usr/src/app
RUN clojure -T:build uber && \
mv target/emqx-snowflake-proxy-*-standalone.jar app-standalone.jar

CMD ["java", "-jar", "app-standalone.jar"]
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ java -jar target/emqx-snowflake-proxy-0.0.0-standalone.jar
java -jar target/emqx-snowflake-proxy-0.0.0-standalone.jar -D taoensso.timbre.config.edn='{:min-level :info}'
```
## docker
```bash
docker build . -t emqx/emqx-snowflake-proxy
docker run -v ./config.edn:/usr/src/app/config.edn emqx/emqx-snowflake-proxy
```
## testing
```sh
Expand Down

0 comments on commit 3dfc0db

Please sign in to comment.