traccar-docker/README.md

68 lines
6.6 KiB
Markdown
Raw Normal View History

2018-04-22 23:07:15 +00:00
Traccar in Docker
2019-05-10 20:17:55 +00:00
===
2018-04-22 23:07:15 +00:00
Traccar GPS Tracking System in Docker image.
2016-09-06 22:40:23 +00:00
2017-09-03 14:02:58 +00:00
Official website: <https://www.traccar.org>
2020-02-19 06:28:36 +00:00
[![](https://images.microbadger.com/badges/version/traccar/traccar:4.8.svg)](https://microbadger.com/images/traccar/traccar:4.8)
2017-09-03 14:02:58 +00:00
### Current tags:
2020-02-19 06:28:36 +00:00
- **4.8-alpine**, **4.8**, **alpine** or **latest** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.8/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.8-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.8-alpine)
- **4.8-debian**, **debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.8/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.8-debian.svg)](https://microbadger.com/images/traccar/traccar:4.8-debian)
- **4.7-alpine**, **4.7** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.7/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.7-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.7-alpine)
- **4.7-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.7/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.7-debian.svg)](https://microbadger.com/images/traccar/traccar:4.7-debian)
- **4.6-alpine**, **4.6** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.6/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.6-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.6-alpine)
- **4.6-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.6/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.6-debian.svg)](https://microbadger.com/images/traccar/traccar:4.6-debian)
- **4.5-alpine**, **4.5** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.5/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.5-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.5-alpine)
- **4.5-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.5/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.5-debian.svg)](https://microbadger.com/images/traccar/traccar:4.5-debian)
- **4.4-alpine**, **4.4** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.4/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.4-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.4-alpine)
- **4.4-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/v4.4/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.4-debian.svg)](https://microbadger.com/images/traccar/traccar:4.4-debian)
2019-05-01 09:45:19 +00:00
- **4.3-alpine**, **4.3** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/4.3/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.3-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.3-alpine)
- **4.3-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/4.3/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.3-debian.svg)](https://microbadger.com/images/traccar/traccar:4.3-debian)
2019-02-07 08:18:32 +00:00
- **4.2-alpine**, **4.2** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/4.2/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.2-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.2-alpine)
2019-02-07 08:20:04 +00:00
- **4.2-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/4.2/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.2-debian.svg)](https://microbadger.com/images/traccar/traccar:4.2-debian)
2018-11-16 20:28:35 +00:00
- **4.1-alpine**, **4.1** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/4.1/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.1-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.1-alpine)
- **4.1-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/4.1/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.1-debian.svg)](https://microbadger.com/images/traccar/traccar:4.1-debian)
2018-10-29 08:33:28 +00:00
- **4.0-alpine**, **4.0** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/4.0/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.0-alpine.svg)](https://microbadger.com/images/traccar/traccar:4.0-alpine)
2018-11-16 20:28:35 +00:00
- **4.0-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/4.0/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:4.0-debian.svg)](https://microbadger.com/images/traccar/traccar:4.0-debian)
2018-08-06 21:11:20 +00:00
- **3.17-alpine**, **3.17** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/3.17/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:3.17-alpine.svg)](https://microbadger.com/images/traccar/traccar:3.17-alpine)
2018-11-16 20:28:35 +00:00
- **3.17-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/3.17/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:3.17-debian.svg)](https://microbadger.com/images/traccar/traccar:3.17-debian)
2018-05-26 20:50:15 +00:00
- **3.16-alpine**, **3.16** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/3.16/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:3.16-alpine.svg)](https://microbadger.com/images/traccar/traccar:3.16-alpine)
- **3.16-debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/3.16/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:3.16-debian.svg)](https://microbadger.com/images/traccar/traccar:3.16-debian)
2018-04-22 23:07:15 +00:00
### Container creation example:
1. **Create work directories:**
```bash
mkdir -p /var/docker/traccar/logs
```
1. **Get default traccar.xml:**
```bash
docker run \
--rm \
--entrypoint cat \
2019-05-01 09:45:19 +00:00
traccar/traccar:latest \
/opt/traccar/conf/traccar.xml > /var/docker/traccar/traccar.xml
```
2019-05-01 09:49:20 +00:00
1. **Edit traccar.xml:** <https://www.traccar.org/configuration-file/>
1. **Create container:**
```bash
docker run \
-d --restart always \
--name traccar \
--hostname traccar \
-p 80:8082 \
-p 5000-5150:5000-5150 \
-p 5000-5150:5000-5150/udp \
-v /var/docker/traccar/logs:/opt/traccar/logs:rw \
-v /var/docker/traccar/traccar.xml:/opt/traccar/conf/traccar.xml:ro \
2019-05-01 09:45:19 +00:00
traccar/traccar:latest
```
### Default JRE options:
- -Xms512m
- -Xmx512m
- -Djava.net.preferIPv4Stack=true