Docker/Rsync
From charlesreid1
Docker container running rsync: https://git.charlesreid1.com/docker/d-rsync
Overview
This covers how to run an rsync daemon/server via an rsync container.
Purpose
The purpose of running rsync in a docker container is for consistency - we are already running an stunnel docker container, listening for the rsync traffic, so I wanted to run the rsync server in a container as well.
Basic workflow is as follows:
- Makefile is where the user starts/executes commands
- The Makefile contains a call to the docker build and docker run scripts, and tells the user to open the firewall.
- The build script just calls docker build
- The run script calls docker run, and connects the host and container port. It also sets a host directory to mount as a volume. This directory should contain whatever is being rsync'ed.
- The Dockerfile contains all the other details needed, and concludes by calling a start script
- The start script starts the rsync daemon, then (to prevent the container from dying) runs
tail -f /dev/null
to keep something actively running in the container.
Link to the Makefile: https://git.charlesreid1.com/docker/d-rsync
Link to build script: https://git.charlesreid1.com/docker/d-rsync/src/master/build_rsync.sh
Link to run script: https://git.charlesreid1.com/docker/d-rsync/src/master/run_rsync.sh
Link to rsync configuration script /etc/rsyncd.conf
: https://git.charlesreid1.com/docker/d-rsync/src/master/rsyncd.conf
Link to Dockerfile: https://git.charlesreid1.com/docker/d-rsync/src/master/Dockerfile
Link to startup script that prevents Docker container from dying when all commands finish: https://git.charlesreid1.com/docker/d-rsync/src/master/start_rsync_container.sh
Note: if you have a /etc/rsyncd.conf
file in place on the docker host machine, rsync will probably be one of the services that starts on boot. To stop the host rsync from starting on boot, run:
$ rm /etc/init.d/rsync
Flags
docker notes on the virtual microservice container platform
Installing the docker platform: Docker/Installing Docker Hello World: Docker/Hello World
Creating Docker Containers: Getting docker containers from docker hub: Docker/Dockerhub Creating docker containers with dockerfiles: Docker/Dockerfiles Managing Dockerfiles using git: Docker/Dockerfiles/Git Setting up Python virtualenv in container: Docker/Virtualenv
Running docker containers: Docker/Basics Dealing with volumes in Docker images: Docker/Volumes Removing Docker images: Docker/Removing Images Rsync Docker Container: Docker/Rsync
Networking with Docker Containers:
|
docker pods pods are groups of docker containers that travel together
Docker pods are collections of Docker containers that are intended to run in concert for various applications.
Wireless Sensor Data Acquisition Pod The wireless sensor data acquisition pod deploys containers This pod uses the following technologies: Stunnel · Rsync · Apache · MongoDB · Python · Jupyter (numerical Python stack)
Deep Learning Pod This pod utilizes the following technologies: Python · Sklearn · Jupyter (numerical Python stack) · Keras · TensorFlow
|