N
N
nexcode2016-07-03 17:17:12
linux
nexcode, 2016-07-03 17:17:12

How to run docker containers correctly?

Good afternoon. Never used docker.
Actually, the question is as follows:
For example, in this container - https://hub.docker.com/r/hwdsl2/ipsec-vpn-server/
The following command is specified to start the container:

docker run \
    --name ipsec-vpn-server \
    --env-file ./vpn.env \
    -p 500:500/udp \
    -p 4500:4500/udp \
    -v /lib/modules:/lib/modules:ro \
    -d --privileged \
    hwdsl2/ipsec-vpn-server

Actually, why are the keys separated by a backslash?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zzamzam, 2016-07-03
@nexcode

This is done just for convenience, because. in nix, a backslash allows you to break a single-line command into several lines, which in this case increases readability
. Same command:
docker run --name ipsec-vpn-server --env-file ./vpn.env -p 500:500/udp - p 4500:4500/udp -v /lib/modules:/lib/modules:ro -d --privileged hwdsl2/ipsec-vpn-server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question