Skip to content

Create Dockerfile - #13

Open
segator wants to merge 1 commit into
kanocz:masterfrom
segator:feature/createDockerFile
Open

Create Dockerfile#13
segator wants to merge 1 commit into
kanocz:masterfrom
segator:feature/createDockerFile

Conversation

@segator

@segator segator commented Feb 10, 2019

Copy link
Copy Markdown

I created the lcvpn docker
to build & run

docker build  -t segator/lcvpn .
docker run -d --name lcvpn  -v /my/lcvpn.conf:/config/lcvpn.conf  -p 25001:25001/udp segator/lcvp

@kanocz

kanocz commented Feb 10, 2019

Copy link
Copy Markdown
Owner

@segator I have 2 questions :)

  1. what's a reason to run VPN in docker? you're almost separated from global network and this lcvpn instance will be mostly limited to only docket container... I can image that it will has access to other docker containers and so on, but this will require little bit complicated configuration
  2. why you're using 'alpine' as basic image + doing some magic with symbolic links (libc.musl-x86_64.so.1 to ld-linux-x86-64.so.2)? golang creates static binary which doesn't require any external library or file, so empty container with only lcvpn binary (and external volume with config which can direct to host filesystem) will be more then enough

@segator

segator commented Feb 10, 2019

Copy link
Copy Markdown
Author

This is q common case when using alpine in go, i saw in a lot of docker go apps, in fact lcvpn doesnt work if dont set, why docker? Because is very easy to setup, if -net host then tun is created on the host so any app can use it

@kanocz

kanocz commented Feb 11, 2019

Copy link
Copy Markdown
Owner

@segator

  1. you don't need alpine - just use FROM scratch :) it will work and resulting container will be many times smaller :) and I believe that it will work without any problems
  2. ok then :) but please add instruction of usage to README or add something like docker-readme.txt where -net host is also there, so users who don't use docker on daily basis will not reports bugs as nothing works :)

@l0k18

l0k18 commented Feb 11, 2019

Copy link
Copy Markdown

There is also a method for building an ultra-slim container for running Go applications, it involves starting first with a full build and then it rips out everything except what Go needs.

https://blog.codeship.com/building-minimal-docker-containers-for-go-applications/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants