Documentation
Deployment
Docker - Offline Installation

Docker - Offline Installation

You can run CloudQuery in a container with plugins pre-installed. This is useful for isolated deployments where you don't want to download plugins from the internet.

To download the plugins based on your configuration file, use the cloudquery plugin install command. Below is an example Dockerfile based on the CloudQuery container. It uses a build.spec.yaml with the minimum configuration required to download the plugins.

# build.spec.yaml
kind: source
spec:
  name: aws
  path: cloudquery/aws
  registry: cloudquery
  version: "v22.19.2"
  tables: ["aws_ec2_instances"]
  destinations: ["postgresql"]
---
kind: destination
spec:
  name: "postgresql"
  path: "cloudquery/postgresql"
  registry: "cloudquery"
  version: "v7.3.4"
  spec:
# Dockerfile
FROM ghcr.io/cloudquery/cloudquery:latest
WORKDIR /app
COPY ./build.spec.yaml /app/build.spec.yaml

RUN /app/cloudquery plugin install cloudquery.yaml

Build this container as you would normally do:

docker build ./ -t my-cq-container:latest

Run the Container

Run the container as you would run the default CloudQuery container. Here is an example:

docker run \
  # you can mount a different config file that uses the same plugins as in the build.spec 
  -v <ABSOLUTE_PATH_TO_CONFIG_FILE>:/config.yml \
  # set any env variable with -e <ENV_VAR_NAME>=<ENV_VAR_VALUE>
  my-cq-container:latest \
  sync /config.yml

Related docs

Read more about the plugin install command in the CLI Documentation.