I’m trying to run a binary within a docker swarm, following along in the Docker tutorial:
I’ve verified that the binary actually executes as expected when I launch the docker machines’ hosts within VirtualBox and execute the binary from the guest Ubuntu CLI. How can I get more info about why my app exits when run inside a container, but not from the CLI of the guest VM?
Dockerfile:
FROM scratch
WORKDIR /bin
COPY . /bin/
EXPOSE 8000
ENV NAME World
CMD ["./app"]
docker-compose.yaml:
version: “3”
services:
web:
image: tamborello/get-started:lisp-app
deploy:
replicas: 2
resources:
limits:
cpus: “0.1”
memory: 50M
restart_policy:
condition: on-failure
Do I need this statement if I’m not remapping ports?
ports:
- "8000:8000"
networks:
- webnet
networks:
webnet:
However, when I attempt to deploy to the swarm, the application apparently exits immediately. Furthermore, there should only be two nodes, but I get many more IDs indicated.
Squid:Ex2 frank$ docker stack deploy -c docker-compose.yml hello-lisp
Updating service hello-lisp_web (id: q7o7g5e7u575ldu12tuqilxs4)
Squid:Ex2 frank$ docker stack ps hello-lisp
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
iv0fxkxvfl0o hello-lisp_web.1 tamborello/get-started:lisp-app slab Ready Ready 3 seconds ago
mps39h4ehfmk _ hello-lisp_web.1 tamborello/get-started:lisp-app donk Shutdown Failed 3 seconds ago “task: non-zero exit (1)”
smck0kngmm0p _ hello-lisp_web.1 tamborello/get-started:lisp-app donk Shutdown Failed 10 seconds ago “task: non-zero exit (1)”
hkxzsvcd15v7 _ hello-lisp_web.1 tamborello/get-started:lisp-app donk Shutdown Failed 16 seconds ago “task: non-zero exit (1)”
timrdxrbfpag _ hello-lisp_web.1 tamborello/get-started:lisp-app donk Shutdown Failed 22 seconds ago “task: non-zero exit (1)”
pb74s7p7c1zc hello-lisp_web.2 tamborello/get-started:lisp-app donk Ready Ready 3 seconds ago
wxnupb6kx6qx _ hello-lisp_web.2 tamborello/get-started:lisp-app slab Shutdown Failed 3 seconds ago “task: non-zero exit (1)”
y5cpulsnt9nc _ hello-lisp_web.2 tamborello/get-started:lisp-app slab Shutdown Failed 9 seconds ago “task: non-zero exit (1)”
tnyswuuisscn _ hello-lisp_web.2 tamborello/get-started:lisp-app slab Shutdown Failed 15 seconds ago “task: non-zero exit (1)”
rfyzl9qp6wjn _ hello-lisp_web.2 tamborello/get-started:lisp-app slab Shutdown Failed 22 seconds ago “task: non-zero exit (1)”
Squid:Ex2 frank$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Squid:Ex2 frank$ docker service logs hello-lisp_web
hello-lisp_web.2.reu7k2v8iylx@slab | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.1.4cjg96wcm4yd@slab | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.2.65iv87sbcdjy@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.1.kwuvgjvnldvl@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.2.995952efkzvr@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.1.ly3v0m0qgtls@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.2.6trjw2eg9bic@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.1.333spbndcng8@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
Squid:Ex2 frank$ docker service logs hello-lisp_web
hello-lisp_web.1.v5cpqznvkgw5@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.1.qrk2hy4gbwy7@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.1.sgpm87slzr7j@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.2.pulbq8dsuzy1@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.2.taitrdq7rq15@donk | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.1.cxb7evvh2wd6@slab | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.2.cyuw78nm8yst@slab | standard_init_linux.go:190: exec user process caused “no such file or directory”
hello-lisp_web.2.rpre3j9eeeqi@slab | standard_init_linux.go:190: exec user process caused “no such file or directory”