diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..1c83dd4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,22 @@ +name: Deploying Image on Release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Logging into Github Container Registry + run: | + echo $CR_PAT | docker login ghcr.io -u utkarsh-1905 --password-stdin + env: + CR_PAT: ${{ secrets.CR_PAT }} + - name: Building Docker Image + run: | + docker build . -t ghcr.io/utkarsh-1905/docker-network-vis:${{ github.sha }} + - name: Pushing Docker Image + run: | + docker push ghcr.io/utkarsh-1905/docker-network-vis:${{ github.sha }} diff --git a/.gitignore b/.gitignore index cde952b..2190421 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -TODO.md \ No newline at end of file +TODO.md +start.dev.sh +*.exe \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f39a268..eb6ef4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,6 @@ LABEL traefik.port=80 LABEL traefik.http.routers.network.rule="Host(`network.utkarsh.ninja`)" LABEL traefik.http.routers.network.tls=true LABEL traefik.http.routers.network.tls.certresolver="lets-encrypt" +LABEL org.opencontainers.image.source="https://github.com/utkarsh-1905/docker-network-vis" EXPOSE 3000 CMD [ "./main.exe" ] diff --git a/Readme.md b/Readme.md index 83be38c..1715d64 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,10 @@ -### Current UI +### How to use -![UI](./assets/ui-1.png) +1. Clone the repository +2. Run the start.sh bash file in your linux terminal to build and start the container on local port 6904. +3. Open your browser and go to localhost:6904 and you should see the app running and displaying all your containers in your network buckets. + +### Why to use? + +1. It is a very simple application to give you a quick overview of all your containers in your network buckets. +2. It helps in debugging and testing your containers. diff --git a/assets/ui-1.png b/assets/ui-1.png deleted file mode 100644 index 8d628e3..0000000 Binary files a/assets/ui-1.png and /dev/null differ diff --git a/start.sh b/start.sh index 4bd9ca7..8863e52 100644 --- a/start.sh +++ b/start.sh @@ -1 +1,2 @@ -sudo docker run -d -p 6904:3000 --rm --net web --name docker-vis -v /var/run/docker.sock:/var/run/docker.sock docker-vis:latest \ No newline at end of file +sudo docker build . -t docker-vis:latest +sudo docker run -d -p 6904:3000 --rm --net web --net bridge --name docker-vis -v /var/run/docker.sock:/var/run/docker.sock docker-vis:latest \ No newline at end of file diff --git a/utils/error.go b/utils/error.go index b1f539f..045adcf 100644 --- a/utils/error.go +++ b/utils/error.go @@ -1,7 +1,9 @@ package util +import "log" + func HandleError(err error) { if err != nil { - panic(err) + log.Fatal(err) } } diff --git a/views/index.html b/views/index.html index bd95261..bc767e8 100644 --- a/views/index.html +++ b/views/index.html @@ -17,7 +17,7 @@

Docker Network Visualizer

-
+

Networks