---
title: Docker
description: A guide for running Conky with Docker
indexWeight: 0
---

## Getting the image

Build the image with:

```shell-session
docker build --tag=conky .
```

If you want the command-line version, use:

```shell-session
docker build --build-arg X11=no --tag=conkycmd .
```

## Running the container

After building, you can run the graphical version with:

```shell-session
docker run --rm -ti --net=host -e DISPLAY -v ~/.Xauthority:/root/.Xauthority conky
```

The command-line version is simpler:

```shell-session
docker run --rm -ti conkycmd
```

To pass options to Conky, specify `conky` twice: once as the image name and
once as the command. For example:

```shell-session
docker run --rm -ti --net=host -e DISPLAY -v ~/.Xauthority:/root/.Xauthority conky conky --version
```

This prints the Conky version. Because X is not required for this command, you
can also run:

```shell-session
docker run --rm -ti conkycmd conky --version
```

If you want to experiment with the configuration first, run:

```shell-session
docker run --rm -ti --net=host -e DISPLAY -v ~/.Xauthority:/root/.Xauthority conky bash
```

_Make any changes you want in the configuration._

```shell-session
conky -c configurationfile ; exit
```

See the Docker documentation for many other ways to use this container.

## Why?

Disadvantages of using Docker:

- You need to install Docker.
  This can be done by following the instructions in
  https://docs.docker.com/install/ to install Docker CE. Installing it through
  your distribution's package manager may also work.
- Much of the information displayed will reflect the current container rather
  than the entire host system.
- At the moment, the Docker image is still under development.

Advantages of using Docker:

- During installation, you do not need to worry as much about which compilers
  and libraries are installed, or how they are configured.
- Containerizing Conky makes it much less likely that problems with Conky will
  affect the rest of the system.
- Your Conky will run in exactly the same environment as everyone else's, so
  if it works for one person, it should work for others as well, regardless of
  distribution or host configuration. The Conky configuration itself, and the
  Conky version, still matter.
- Problems are easier for developers to reproduce, which can lead to faster
  debugging.
