Open istvankerek opened 3 years ago
Its Oct 18th ... just tried getting this docker running.
same issues - missing /vars file (read the issues) ... missing ovpn_env.sh (read the issues).
Can we get a good, working version somewhere?
Same issue! ovpn_env.sh
is completely missing! How do I use this container?
@skupjoe Make sure to use docker compose version >= 3.2 and use bind instead of volume for the /etc/openvpn/
path.
Hi @dayjaby -
Thanks. I tried this (I was previously on 2.4), but I still experienced the same issue.
Ultimately, I needed to create an empty ovpn_env.sh
file and mount this to /etc/openvpn/ovpn_env.sh
to get passed the error.
I think the error is due to using bind mounts on the /etc/openvpn
directory. If you do this, then this will replace any built-in volumes on that directory which the container is already using.
For me, the issue is further compounded because I am using openvpn in client mode only and I am supplying my own openvpn.conf
via bind mount:
volumes:
- /svc/openvpn/etc/openvpn.conf:/etc/openvpn/openvpn.conf
- /svc/openvpn/etc/ovpn_env.sh:/etc/openvpn/ovpn_env.sh
I am not really using any of the /bin
scripts and I didn't perform the steps in the Quick Start, so maybe ovpn_env.sh
gets created in the process.
Side note
I also found that I needed to set the following to get the container to boot, likely because some env's aren't being set via the missing ovpn_env.sh
:
environment:
- OVPN_SERVER=${IPADDR}
Thankfully, this was all I needed to get passed the boot error and have openvpn run fine in client-only mode.
@istvankerek Can you add more details on what would be in the IPADDR
env?
Hi @dayjaby -
Thanks. I tried this (I was previously on 2.4), but I still experienced the same issue.
Ultimately, I needed to create an empty
ovpn_env.sh
file and mount this to/etc/openvpn/ovpn_env.sh
to get passed the error.
Can you tell us how you did it? Thanks!
Hi @dayjaby - Thanks. I tried this (I was previously on 2.4), but I still experienced the same issue. Ultimately, I needed to create an empty
ovpn_env.sh
file and mount this to/etc/openvpn/ovpn_env.sh
to get passed the error.Can you tell us how you did it? Thanks!
Sure-
You can use a volume mount in your docker-compose.yaml
as so:
openvpn:
image: kylemanna/openvpn:latest
container_name: openvpn
hostname: openvpn
cap_add:
- NET_ADMIN
- NET_RAW
volumes:
- ./bin/ovpn_env.sh:/etc/openvpn/ovpn_env.sh
In my situation, I am actually providing a bash script for this file that has some custom things that I do when provisioning this image. But if you don't have an actual script at ./bin/ovpn_env.sh
then it will mount a blank file which I think should work fine.
Let me know if you run into any trouble.
Hello, I use this docker-compose.yml but not working for me I got error. Please help me If it is possible. Thank you!
When I try to run this command on Ubuntu 20.04 terminal I got this message:
When I run ovpn_initpki I got this message
I use docker as root, the folders made by root and owned too. The 1194 port is opened.
I tryed this too: (https://github.com/kylemanna/docker-openvpn/issues/35#issuecomment-478297237)
I made a bash file (addUser.sh) to generate .ovpn files
But I got this errors inside the files
sh addUser.sh username
When I run Debugging Tips I got this message
When I run logs I got this message
I made something in a wrong way or this is a bug?