Closed hetz closed 6 years ago
You should create that file in container but not your host.
thx 🍰 ,I want mount ocpasswd out of docker container. so I run script
sudo docker run --name ocserv \
--privileged \
-p 443:443 -p 443:443/udp \
-e CA_CN="VPN CA" \
-e CA_ORG="Inc." \
-e CA_DAYS=3650 \
-e SRV_CN=inner--vpn.test.com \
-e SRV_ORG="Inc." \
-e SRV_DAYS=365 \
-e NO_TEST_USER=1 \
-v /home/ubuntu/tools/tommylau_ocserv/ocpasswd:/etc/ocserv/ocpasswd \
-d tommylau/ocserv
success run.
but I run
docker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd -g "Route,All" tommy
I get error file '/etc/ocserv/ocpasswd' is locked.
OK, I see.
I suggest you to mount a directory other than a file.
-v /home/yourname/ocserv:/etc/ocserv
That way you can also modify the configuration file out of the container.
Yet better way is to use certificate method.
thank i got it 👍
-v /home/yourname/ocserv:/etc/ocserv
Still does not work
Ubuntu 16 AWS always say ocpasswd can't write or locked.