The above dockerfile is probably accurate. As you can see there is some stuff going on in the backend when this container is built, so it's not a complete picture of what is going on, but it gets the gist of the thing across I think. Note that I'm pretty new to docker, so there's some things in there that probably don't make sense.
The errors I'm getting are really just /bin/sh: can't open '...'. However, replacing CMD with something basic, like echo or ls doesn't fix that issue. However, having done a little testing, setting ENTRYPOINT doesn't have any effect, just changes the name the sh binary uses to report errors...
Sorry I'm just getting to this, but I think I've worked out a few issues in your example. Without the contents of your home directory, it's difficult to say for certain whether these fixes will work for you, but here's a list of the issues / fixes. I imagine that the
code.dfrom the above example could easily replace thetest.dfrom the below example.alpine-ldcimage is to serve as the first layer in a multi stage build. You should be basing your first layer off ofandrewbenton/alpine-ldcand building your binary in that layer before passing it off to your final layer for running.USERstatement after theCMDis effectively a no-op."ldc-flags": [ "-static" ]to the properties so that a static binary is produced.&&in the list of arguments toCMDis just treated as another argument to/ldc/bin/ldcinstead of allowing execution of a subsequent command, which I believe is the intended effect.Small example below:
./source/test.d:./Dockerfile.ldc-test:./dub.json:{ "name": "test", "authors": [ "Andrew Benton" ], "description": "A minimal D application.", "copyright": "Copyright © 2018, Andrew Benton", "license": "proprietary", "targetType": "executable", "dflags-ldc": [ "-static" ] }Build with:
docker build -f Dockerfile.ldc-test -t run-issue .Run with:
docker run -it --rm run-issue:latestordocker run -it --rm run-issue:latest /test a b c d e f gPlease let me know whether that was helpful or not. I'd like to resolve your issue if I can.