We build only MySQL. Our local adjustment to the official image is simply adding `/tmp/mysql` to it. See [build-context/mysql/Dockerfile](build-context/mysql/Dockerfile). We use `/tmp/mysql` to bind-mount a dedicated ZFS dataset for MySQL `tmpdir` location.
Copy images to target Docker host, that is assuming you deploy to a machine that itself has no network route to reach Docker Hub. Copying in its simplest form involves a local `docker save` and a remote `docker load`. Consider the helper mini-project [quico.space/Quico/copy-docker](https://quico.space/Quico/copy-docker) where [copy-docker.sh](https://quico.space/Quico/copy-docker/src/branch/main/copy-docker.sh) allows the following workflow:
Copy images to target Docker host, that is assuming you deploy to a machine that itself has no network route to reach Docker Hub. Copying in its simplest form involves a local `docker save` and a remote `docker load`. Consider the helper mini-project [quico.space/Quico/copy-docker](https://quico.space/Quico/copy-docker) where [copy-docker.sh](https://quico.space/Quico/copy-docker/src/branch/main/copy-docker.sh) allows the following workflow:
Place the following files on target server. Use the directory structure at [build-context](build-context) as a guide, specifically at `docker-data`.
Place both a `my.cnf` and `traccar.xml` file on target server. Use the directory structure at [build-context](build-context) as a guide, specifically at `docker-data`.
```
```
build-context/
build-context/
├── mysql
├── mysql
│  ├── docker-data
│ └── docker-data
│  │  ├── config
│ └── config
│  │  │  ├── db
│ └── db
│  │  │  │  └── my.cnf
│ └── my.cnf
│  │  │  └── docker-entrypoint-initdb.d
│  │  └── data
│  │  ├── datadir
│  │  └── tmpdir
│  ├── ...
│  └── ...
└── traccar
└── traccar
├── docker-data
└── docker-data
│  ├── config
└── config
│  │  └── traccar.xml
└── traccar.xml
│  └── data
├── ...
└── ...
```
```
The [example my.cnf](build-context/mysql/docker-data/config/db/my.cnf) config file for MySQL follows [Traccar's recommendation for MySQL](https://www.traccar.org/mysql-optimization/) but uses 512 MiB of RAM instead of Traccar's 3 GiB example. We also add a `tmpdir` whose location gets created in our custom MySQL image up top during [Build](#build). Lastly since we live in a world with MySQL 8.0.30+ we're using `innodb_redo_log_capacity` over Traccar's recommendation (as of Thursday, June 22, 2023) of `innodb_log_file_size`. See also [MySQL 8.0 docs section "Configuring Redo Log Capacity (MySQL 8.0.30 or Higher)"](https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log.html#innodb-modifying-redo-log-capacity).
The [example my.cnf](build-context/mysql/docker-data/config/db/my.cnf) config file for MySQL follows [Traccar's recommendation for MySQL](https://www.traccar.org/mysql-optimization/) but uses 512 MiB of RAM instead of Traccar's 3 GiB example. Since we live in a world with MySQL 8.0.30+ we're using `innodb_redo_log_capacity` over Traccar's recommendation (as of Wednesday, March 5, 2025) of `innodb_log_file_size`. See also [MySQL 8.0 docs section "Configuring Redo Log Capacity (MySQL 8.0.30 or Higher)"](https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log.html#innodb-modifying-redo-log-capacity).
In `docker-entrypoint-initdb.d` you can store database initialization scripts that are run when you start MySQL without any data. See also [MySQL 8.0 docs section "Running Additional Initialization Scripts"](https://dev.mysql.com/doc/refman/8.0/en/docker-mysql-more-topics.html#docker-additional-init).
In `docker-entrypoint-initdb.d` you can store database initialization scripts that are run when you start MySQL without any data. See also [MySQL 9.2 docs section "Running Additional Initialization Scripts"](https://dev.mysql.com/doc/refman/9.2/en/docker-mysql-more-topics.html#docker-additional-init).
Config `traccar.xml` is a minimal working example file taken from the Traccar Docker image. See [Docker Hub traccar/traccar overview](https://hub.docker.com/r/traccar/traccar) section "Get default traccar.xml". In [our example traccar.xml](build-context/traccar/docker-data/config/traccar.xml) file the default H2 database is replaced with MySQL to match this repo.
Config `traccar.xml` is a minimal working example file taken from the Traccar Docker image. See [Docker Hub traccar/traccar overview](https://hub.docker.com/r/traccar/traccar) section "Get default traccar.xml". In [our example traccar.xml](build-context/traccar/docker-data/config/traccar.xml) file the default H2 database is replaced with MySQL to match this repo.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.