diff --git a/README.md b/README.md index e6cf98f..bd08e7b 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ ![Argus](https://socialify.git.ci/VibhorCodecianGupta/Argus/image?description=1&language=1&pattern=Circuit%20Board&stargazers=1&theme=Light) ---- - ## Overview and Intent A TypeScript-based alternative to [watchtower](https://github.com/v2tec/watchtower) @@ -28,7 +26,15 @@ Automating the process of watching your containers, looking for latest images on ## Usage -`Argus` is deployed via docker image like so: +**NPM package** + +`Argus` is available in the npm registry as a package. To use: + +`yarn global add argus-docker` or `npm i -g argus-docker` + +**Docker Image** + +`Argus` is also deployed via docker image like so: ```bash docker run -d --name argus \ @@ -68,81 +74,143 @@ Argus can monitor things other than just local, pass the `--host` argument to up Defaults to `/var/run/docker.sock` +1. Running the docker image + ```bash docker run -d --name argus \ -v /var/run/docker.sock:/var/run/docker.sock \ whaleit/argus --host='tcp://some-remote-docker-server:2375' ``` +2. Running the npm package + +```bash +argus --host='tcp://some-remote-docker-server:2375' +``` + ### Change update interval An `interval` argument can be supplied to change interval b/w argus checking the remote docker registry for image updates (in seconds). Defaults to `300` seconds +1. Running the docker image + ```bash docker run -d --name argus \ -v /var/run/docker.sock:/var/run/docker.sock \ whaleit/argus --interval=900 ``` +2. Running the npm package + +```bash +argus --interval=900 +``` + ### Monitor select containers Argus monitors all running docker containers, but can be overridden to only monitor select containers by passing `monitor` supplied with container names. Defaults to all containers +1. Running the docker image + ```bash docker run -d --name argus \ -v /var/run/docker.sock:/var/run/docker.sock \ whaleit/argus --monitor='containerA','containerB','containerC' ``` +2. Running the npm package + +```bash +argus --monitor='containerA','containerB','containerC' +``` + ### Ignore select containers Argus monitors all running docker containers, but can be overridden to ignore select containers by passing `ignore` supplied with container names. Defaults to none +1. Running the docker image + ```bash docker run -d --name argus \ -v /var/run/docker.sock:/var/run/docker.sock \ whaleit/argus --ignore='containerA','containerB' ``` +2. Running the npm package + +```bash +argus --ignore='containerA','containerB' +``` + ### Update all containers once and quit If you prefer Argus didn't run all the time and only update running containers once and exit, use the `runonce` argument and Argus terminates after updating all containers once. Defaults to `false` +1. Running the docker image + ```bash docker run -d --name argus \ -v /var/run/docker.sock:/var/run/docker.sock \ whaleit/argus --runonce=true ``` +2. Running the npm package + +```bash +argus --runonce=true +``` + ### Remove old docker images Argus has the option to remove the outdated base image if a new one is found and the container is updated. To clean up after updates, pass the `cleanup` argument. Defaults to `false` +1. Running the docker image + ```bash docker run -d --name argus \ -v /var/run/docker.sock:/var/run/docker.sock \ whaleit/argus --cleanup=true ``` +2. Running the npm package + +```bash +argus --cleanup=true +``` + ### Private Registries If base images to running containers are stored in a secure registry that requires credentials, you can run Argus with 2 arguments `--user` and `--password`. +1. Running the docker image + ```bash docker run -d --name argus \ - --user=myUser --password=myPassword \ -v /var/run/docker.sock:/var/run/docker.sock \ - whaleit/argus + whaleit/argus --user='myUser' --password='myPassword' +``` + +2. Running the npm package + +```bash +argus --user='myUser' --password='myPassword' +``` + +Credentials can also be passed via environment variables. Set the environment vars in your command line environment prior to running Argus like so: + +```bash +export REPO_USER=myUser +export REPO_PASS=myPassword ``` --- diff --git a/package.json b/package.json index 7d68602..f4d5190 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,14 @@ { "name": "argus-docker", - "version": "0.1.0", + "version": "0.1.1", "description": "Automate container quit and rerun as the base image updates", "main": "index.js", "repository": "https://github.com/VibhorCodecianGupta/Argus.git", "homepage": "https://github.com/VibhorCodecianGupta/Argus", "bugs": "https://github.com/VibhorCodecianGupta/Argus/issues", + "bin": { + "argus": "./dist/index.js" + }, "author": "VibhorCodecianGupta ", "keywords": [ "docker", @@ -20,6 +23,8 @@ "dev": "ts-node src/index.ts", "build": "tsc", "start": "yarn build && node dist/index.js", + "local": "sudo yarn global add && argus", + "refresh": "rm -rf ./node_modules ./package-lock.json ./yarn.lock && yarn install", "lint": "eslint . --ext .ts" }, "dependencies": {