From 9e03d745d82f30eeab39406392403301d6ac1828 Mon Sep 17 00:00:00 2001 From: Patrick Robertson Date: Mon, 17 Mar 2025 09:45:12 +0000 Subject: [PATCH] Add '-it' to the list of docker flags, so that docker gives a colour log output --- README.md | 2 +- docs/source/how_to/gsheets_setup.md | 2 +- docs/source/installation/setup.md | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8baa722..b8dd530 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ View the [Installation Guide](https://auto-archiver.readthedocs.io/en/latest/ins To get started quickly using Docker: -`docker pull bellingcat/auto-archiver && docker run --rm -v secrets:/app/secrets bellingcat/auto-archiver --config secrets/orchestration.yaml` +`docker pull bellingcat/auto-archiver && docker run -it --rm -v secrets:/app/secrets bellingcat/auto-archiver --config secrets/orchestration.yaml` Or pip: diff --git a/docs/source/how_to/gsheets_setup.md b/docs/source/how_to/gsheets_setup.md index ade8024..af17274 100644 --- a/docs/source/how_to/gsheets_setup.md +++ b/docs/source/how_to/gsheets_setup.md @@ -86,7 +86,7 @@ gsheet_feeder_db: You can also pass these settings directly on the command line without having to edit the file, here'a an example of how to do that (using docker): -`docker run --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver:dockerize --gsheet_feeder_db.sheet "My Awesome Sheet 2"`. +`docker run -it --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver:dockerize --gsheet_feeder_db.sheet "My Awesome Sheet 2"`. Here, the sheet name has been overridden/specified in the command line invocation. diff --git a/docs/source/installation/setup.md b/docs/source/installation/setup.md index 0911b75..10691ee 100644 --- a/docs/source/installation/setup.md +++ b/docs/source/installation/setup.md @@ -27,17 +27,18 @@ The way you run the Auto Archiver depends on how you installed it (docker instal If you installed Auto Archiver using docker, open up your terminal, and copy-paste / type the following command: ```bash -docker run --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver +docker run -it --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver ``` breaking this command down: 1. `docker run` tells docker to start a new container (an instance of the image) - 2. `--rm` makes sure this container is removed after execution (less garbage locally) - 3. `-v $PWD/secrets:/app/secrets` - your secrets folder with settings + 2. `-it` tells docker to run in 'interactive mode' so that we get nice colour logs + 3. `--rm` makes sure this container is removed after execution (less garbage locally) + 4. `-v $PWD/secrets:/app/secrets` - your secrets folder with settings 1. `-v` is a volume flag which means a folder that you have on your computer will be connected to a folder inside the docker container 2. `$PWD/secrets` points to a `secrets/` folder in your current working directory (where your console points to), we use this folder as a best practice to hold all the secrets/tokens/passwords/... you use 3. `/app/secrets` points to the path the docker container where this image can be found - 4. `-v $PWD/local_archive:/app/local_archive` - (optional) if you use local_storage + 5. `-v $PWD/local_archive:/app/local_archive` - (optional) if you use local_storage 1. `-v` same as above, this is a volume instruction 2. `$PWD/local_archive` is a folder `local_archive/` in case you want to archive locally and have the files accessible outside docker 3. `/app/local_archive` is a folder inside docker that you can reference in your orchestration.yml file @@ -48,14 +49,14 @@ The invocations below will run the auto-archiver Docker image using a configurat ```bash # Have auto-archiver run with the default settings, generating a settings file in ./secrets/orchestration.yaml -docker run --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver +docker run -it --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver # uses the same configuration, but with the `gsheet_feeder`, a header on row 2 and with some different column names # Note this expects you to have followed the [Google Sheets setup](how_to/google_sheets.md) and added your service_account.json to the `secrets/` folder # notice that columns is a dictionary so you need to pass it as JSON and it will override only the values provided -docker run --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver --feeders=gsheet_feeder --gsheet_feeder.sheet="use it on another sheets doc" --gsheet_feeder.header=2 --gsheet_feeder.columns='{"url": "link"}' +docker run -it --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver --feeders=gsheet_feeder --gsheet_feeder.sheet="use it on another sheets doc" --gsheet_feeder.header=2 --gsheet_feeder.columns='{"url": "link"}' # Runs auto-archiver for the first time, but in 'full' mode, enabling all modules to get a full settings file -docker run --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver --mode full +docker run -it --rm -v $PWD/secrets:/app/secrets -v $PWD/local_archive:/app/local_archive bellingcat/auto-archiver --mode full ``` ------------