traccar-docker/README.md

46 lines
1.5 KiB
Markdown
Raw Normal View History

2018-04-22 23:07:15 +00:00
Traccar in Docker
2017-09-03 14:02:58 +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>
2018-03-10 22:37:47 +00:00
Current version: **3.16**
2017-09-03 14:02:58 +00:00
### Current tags:
2018-04-24 22:13:01 +00:00
- **3.16-alpine**, **3.16**, **alpine** or **latest** ([alpine/Dockerfile](https://github.com/traccar/traccar-docker/blob/master/alpine/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:alpine.svg)](https://microbadger.com/images/traccar/traccar:alpine)
- **3.16-debian**, **debian** ([debian/Dockerfile](https://github.com/traccar/traccar-docker/blob/master/debian/Dockerfile)) [![](https://images.microbadger.com/badges/image/traccar/traccar:debian.svg)](https://microbadger.com/images/traccar/traccar: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 \
2018-04-24 22:13:01 +00:00
traccar/traccar \
/opt/traccar/conf/traccar.xml > /var/docker/traccar/traccar.xml
```
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 /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
-v /var/docker/traccar/logs:/opt/traccar/logs:rw \
-v /var/docker/traccar/traccar.xml:/opt/traccar/conf/traccar.xml:ro \
2018-04-24 22:13:01 +00:00
traccar/traccar
```