Thread overview
Containerize Your D Server Application
Mar 14
Meta
6 days ago
Meta
March 14
One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I ever do get around to it, my ignorance of all things Docker will not be the time sink it could have been thanks to this latest post on the D Blog by Kai Nacke.

The Blog
https://dlang.org/blog/2019/03/14/containerize-your-d-server-application/

Reddit
https://www.reddit.com/r/programming/comments/b0zqck/containerize_your_d_server_application/
March 14
On Thursday, 14 March 2019 at 12:38:30 UTC, Mike Parker wrote:
> One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I ever do get around to it, my ignorance of all things Docker will not be the time sink it could have been thanks to this latest post on the D Blog by Kai Nacke.
>
> The Blog
> https://dlang.org/blog/2019/03/14/containerize-your-d-server-application/
>
> Reddit
> https://www.reddit.com/r/programming/comments/b0zqck/containerize_your_d_server_application/

Can we make dub generate the docker container as well? CMake can do that. The usage would be simply

```
dub build -b release
dub build docker
March 14
On Thursday, 14 March 2019 at 18:02:31 UTC, Arun Chandrasekaran wrote:
> On Thursday, 14 March 2019 at 12:38:30 UTC, Mike Parker wrote:
>> One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I ever do get around to it, my ignorance of all things Docker will not be the time sink it could have been thanks to this latest post on the D Blog by Kai Nacke.
>>
>> The Blog
>> https://dlang.org/blog/2019/03/14/containerize-your-d-server-application/
>>
>> Reddit
>> https://www.reddit.com/r/programming/comments/b0zqck/containerize_your_d_server_application/
>
> Can we make dub generate the docker container as well? CMake can do that. The usage would be simply
>
> ```
> dub build -b release
> dub build docker

There is a plugin system planned for dub. This requirement seems to be a very good use case.

https://github.com/dlang/dub/wiki/DEP3

If you have time, please contribute to Dub by adding this feature.

Kind regards
Andre

March 14
On 2019-03-14 13:38, Mike Parker wrote:
> One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I ever do get around to it, my ignorance of all things Docker will not be the time sink it could have been thanks to this latest post on the D Blog by Kai Nacke.
> 
> The Blog
> https://dlang.org/blog/2019/03/14/containerize-your-d-server-application/
> 
> Reddit
> https://www.reddit.com/r/programming/comments/b0zqck/containerize_your_d_server_application/ 
> 

For reducing the container image I recommend building what's called a "microcontainer" [1]. It's a container that only contains exactly what's needed to run the application, no more, no less. That is, it contains no base image. There's a tool called Smith [2] that helps to build these microcontainers. You specify the files you want to have included in the container, then it will use the dynamic linker to figure out all the dependencies of the executables. With LDC it's possible to build a fully statically linked executable, that makes it trivial to build a microcontainer out of.

[1] https://blogs.oracle.com/developers/the-microcontainer-manifesto
[2] https://github.com/oracle/smith

-- 
/Jacob Carlborg
March 14
On Thursday, 14 March 2019 at 18:02:31 UTC, Arun Chandrasekaran wrote:
> On Thursday, 14 March 2019 at 12:38:30 UTC, Mike Parker wrote:
>> One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I ever do get around to it, my ignorance of all things Docker will not be the time sink it could have been thanks to this latest post on the D Blog by Kai Nacke.
>>
>> The Blog
>> https://dlang.org/blog/2019/03/14/containerize-your-d-server-application/
>>
>> Reddit
>> https://www.reddit.com/r/programming/comments/b0zqck/containerize_your_d_server_application/
>
> Can we make dub generate the docker container as well? CMake can do that. The usage would be simply
>
> ```
> dub build -b release
> dub build docker

Couldn't you use `postBuildCommands` for that?
https://dub.pm/package-format-json.html#build-settings
6 days ago
On 3/14/19 8:38 AM, Mike Parker wrote:
> One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I ever do get around to it, my ignorance of all things Docker will not be the time sink it could have been thanks to this latest post on the D Blog by Kai Nacke.
> 
> The Blog
> https://dlang.org/blog/2019/03/14/containerize-your-d-server-application/
> 
> Reddit
> https://www.reddit.com/r/programming/comments/b0zqck/containerize_your_d_server_application/ 
> 

Interestingly, this appears to be by far the best introduction to docker I've ever come across - and that's *including* docker's own vacuous website.
6 days ago
On Friday, 15 March 2019 at 04:43:21 UTC, Nick Sabalausky (Abscissa) wrote:
> On 3/14/19 8:38 AM, Mike Parker wrote:
>> One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I ever do get around to it, my ignorance of all things Docker will not be the time sink it could have been thanks to this latest post on the D Blog by Kai Nacke.
>> 
>> The Blog
>> https://dlang.org/blog/2019/03/14/containerize-your-d-server-application/
>> 
>> Reddit
>> https://www.reddit.com/r/programming/comments/b0zqck/containerize_your_d_server_application/
>> 
>
> Interestingly, this appears to be by far the best introduction to docker I've ever come across - and that's *including* docker's own vacuous website.

Agreed; it's a good starter tutorial to familiarize someone with the basics. Great article Kai!