www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - self contained D executable that runs inside container

reply y <y srtnwz.com> writes:
currently if you want to run a D app inside a linux container you 
need to do a few things.
http://blog.oddbit.com/2015/02/05/creating-minimal-docker-images/ 
has a nice description.

what would need to be done to make this process slimmer and not 
need
e.g. nsswitch.conf and passwd?

in golang the process is included and i can easily create a 
static binary.
is it possible with ldc or dmd to create a similar static binary?
Apr 13 2017
parent Atila Neves <atila.neves gmail.com> writes:
On Thursday, 13 April 2017 at 21:32:03 UTC, y wrote:
 currently if you want to run a D app inside a linux container 
 you need to do a few things.
 http://blog.oddbit.com/2015/02/05/creating-minimal-docker-images/ has a nice
description.

 what would need to be done to make this process slimmer and not 
 need
 e.g. nsswitch.conf and passwd?

 in golang the process is included and i can easily create a 
 static binary.
 is it possible with ldc or dmd to create a similar static 
 binary?
Not all binaries need nsswitch.conf and passwd. As to how to make it simpler, your link itself suggests using dockerize. dmd creates statically linked binaries by default. Usually all you need is the dynamic loader and system runtime libraries for a container. Atila
Apr 14 2017