Docker container exits immediately Upon Run
I am running docker on raspberry pi zero, I am starting watchtower and my container using systemd at startup. my container it self just working if I run it with my hand or run by systemd at startup but when I push new image my private repo watchtower detects new version.. stops, removes and tries to run new version but at this point container exits with 137 immediately (after 3 secs running time).
here is the log of exited container:
pi@raspberrypi:~ $ sudo docker logs 6f2a4282cdfe
Systemd init system enabled.
systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
Detected virtualization 'other'.
Detected architecture 'arm'.
Set hostname to <fc6cd3bd9174>.
Failed to configure loopback device: Permission denied
Received SIGRTMIN+3.
here is the result of inspect command:
[
{
"Id": "e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7",
"Created": "2018-06-07T11:20:34.05859919Z",
"Path": "python",
"Args": [
"-u",
"./firebase.py"
],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 137,
"Error": "",
"StartedAt": "2018-06-07T11:20:41.950594496Z",
"FinishedAt": "2018-06-07T11:20:44.967301585Z"
},
"Image": "sha256:b88bb7323a0c74c54144521c0170b078df4282fe40bc124fd0cf1c5926d0584c",
"ResolvConfPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/hostname",
"HostsPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/hosts",
"LogPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7-json.log",
"Name": "/go-miner-container",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": ,
"DnsOptions": ,
"DnsSearch": ,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": true,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [
"label=disable"
],
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": ,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": ,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": null,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462-init/diff:/var/lib/docker/overlay2/938f7ab70c56b28e84d2444636d4bca2e8f41f82afb1423015f9bf768c788dd9/diff:/var/lib/docker/overlay2/db9771f2ad8ad54e0c07aab69bdd406e6a5f3e2a1abc3a5211a86fb2d509d970/diff:/var/lib/docker/overlay2/569fd809dceb91fc183a0022ae56495a3ef42d5ccf9cf520016aec7cb18918bd/diff:/var/lib/docker/overlay2/98d3eeec7feb2a4e8e6c8d392c73ae3119e0fa540b3782099d9530081960fa66/diff:/var/lib/docker/overlay2/d995e83a8c9b5a5255c82cc2ea99054d66a141af7a804d3894aebbcc96332f1f/diff:/var/lib/docker/overlay2/8e68793b217e1f5bd1788e3b94f17e15cdecc1b6464441d4d5dbee4058892ff0/diff:/var/lib/docker/overlay2/b100534660ed91a94e0e958241507487e13b89c2eb6745c8909979b4c31d8970/diff:/var/lib/docker/overlay2/ce783e4ff7bd08110d439e21791367779d55e39146f55295a658d908f4940975/diff:/var/lib/docker/overlay2/fc15200a4fe254c03f1598b03808f4072d3a4084a63f464b38001bea2ef89b35/diff:/var/lib/docker/overlay2/8a0500ec24f2b0ae05b55d40386f8d1566b32a1ee992a0e7482041648ab4ad30/diff:/var/lib/docker/overlay2/d2f9053d28f7a68e92e5fbb8a373b81d39b9d0168e104d7062d9b8bf3f4d5517/diff:/var/lib/docker/overlay2/8843a6d10e696375160435cc610e0b8ab91523739125bfb6dc8749188447f0be/diff:/var/lib/docker/overlay2/3680e27bc7f42b96e4ecb827fbefbf280c3b31412743723494c9608311889d14/diff:/var/lib/docker/overlay2/39b71a75d4c1aeef3e7fbc83b4778c030d04fefc4559cccab7a8b90f31f24049/diff:/var/lib/docker/overlay2/2cbe5685da3fa2b4c1b52e1eed93978ec4175bbc87ed77210700da08ddab4544/diff:/var/lib/docker/overlay2/bb29132edd2d7ca214d8edf8cb185319a2aa147052563b70a28f834dfb9c87da/diff:/var/lib/docker/overlay2/2f502551a2e74a16159820fd6aacd0c90d55bebc8c581fd1bbd46ab85b4201b5/diff:/var/lib/docker/overlay2/704c34d8f8978cee4485e65fa923f742666ebe8260872991fa8b08c56e7d3f9e/diff:/var/lib/docker/overlay2/214b24ce23b22631cf04b213fed09decc4b2fe08643ceedeecd98feb161d8ade/diff:/var/lib/docker/overlay2/2916cbe9887d1baf5f0d0345913dd6c7d7847a4e217520d261e36851f903ac91/diff:/var/lib/docker/overlay2/4af52cf964a3f100bc7ceec9e96f02b60305e8025556fce2a7e1bcbc399636db/diff:/var/lib/docker/overlay2/a15dba23f7c9f0ffb3c1de9497677862e8cd2adf7506f454b4d38671ca6b5815/diff:/var/lib/docker/overlay2/c6f4dffaf9c651828280cd80747659d2462db727aad47e04d68a25edfa5b9cd4/diff:/var/lib/docker/overlay2/db5507926c9564a2186bda441b3657ae2d7a6fc399df04eed7059be915e6554f/diff:/var/lib/docker/overlay2/9705a3a0d47e0cff848d4aa96f015438f6f30755fe5fc419e9cf6fef83af1c28/diff:/var/lib/docker/overlay2/25493cdc5e50330722910834a72ed517166129bc545eca5d0a2bd07a308ae6a8/diff:/var/lib/docker/overlay2/011396cec2412a73f8ae256fc084b7a3ef96e20f04d22ee06bc1e602005dca92/diff:/var/lib/docker/overlay2/7dbf65ddeff957b111e6b9223e178a597e1b3503236a38ab7dff80b96f0637d7/diff",
"MergedDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/merged",
"UpperDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/diff",
"WorkDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "464aa3db13b65151bc7ca0f264efc415a005548d53a94160b54e4fa1cb55e1f8",
"Source": "/var/lib/docker/volumes/464aa3db13b65151bc7ca0f264efc415a005548d53a94160b54e4fa1cb55e1f8/_data",
"Destination": "/sys/fs/cgroup",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "250a29950ccb",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"Tty": true,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TINI_VERSION=0.14.0",
"LC_ALL=C.UTF-8",
"DEBIAN_FRONTEND=noninteractive",
"UDEV=on",
"QEMU_CPU=arm1176",
"container=docker",
"LANG=C.UTF-8",
"PYTHON_VERSION=3.6.5",
"PYTHON_PIP_VERSION=10.0.1",
"SETUPTOOLS_VERSION=39.1.0",
"PYTHON_DBUS_VERSION=1.2.4",
"PYTHONPATH=/usr/lib/python3/dist-packages:",
"INITSYSTEM=on"
],
"Cmd": null,
"ArgsEscaped": true,
"Image": "beratuslu/gominer:latest",
"Volumes": {
"/sys/fs/cgroup": {}
},
"WorkingDir": "/easylinkraspberry",
"Entrypoint": [
"python",
"-u",
"./firebase.py"
],
"OnBuild": null,
"Labels": {
"io.resin.architecture": "rpi",
"io.resin.device-type": "raspberrypi",
"io.resin.qemu.version": ""
},
"StopSignal": "37"
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "129cc44fd27bb811e19a0c0635b9d387392a9c29c084c9cceaa106e278d8b7e3",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/129cc44fd27b",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "546d9919184787d41e3f1359400ee76cf244f3f298ce406fec5988a6e2c5dae0",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]
here watchtower systemd service:
[Unit]
Description=Watchtower container
Requires=network-online.target docker.service
After=docker.service
[Service]
Restart=never
ExecStartPre=-/usr/bin/docker rm -f watchtower
ExecStart=/usr/bin/docker run --name watchtower --rm -v /var/run/docker.sock:/var/run/docker.sock -e REPO_USER=USER_NAME -e REPO_PASS=PASSWORD v2tec/watchtower:armhf-latest -i 30 --cleanup --debug
ExecStop=/usr/bin/docker stop -t 2 watchtower
[Install]
WantedBy=default.target
here my-app systemd service:
[Unit]
Description=My App
Requires=network-online.target docker.service
After=docker.service
[Service]
# Don't restart, conflicts with Watchtower
Restart=never
ExecStartPre=-/usr/bin/docker rm -f go-miner-container
ExecStart=/usr/bin/docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
ExecStop=/usr/bin/docker stop -t 2 go-miner-container
[Install]
WantedBy=default.target
Here is my Docker file:
FROM resin/raspberry-pi-python:3.6.5-slim
MAINTAINER Berat USLU "berat_uslu@hotmail.com"
# Enable systemd
ENV INITSYSTEM on
# Your code goes here
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git
RUN apt-get install build-essential python-pip python-dev python-smbus python3-smbus
RUN git clone https://github.com/beratuslu/Pyrebase.git
WORKDIR /Pyrebase/
RUN python setup.py install
WORKDIR /
RUN git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
WORKDIR /Adafruit_Python_GPIO/
RUN python setup.py install
WORKDIR /
RUN pip install dictdiffer
RUN pip install smbus2
#RUN apt-get -y install python3-rpi.gpio
RUN pip install RPi.GPIO
# Clone the conf files into the docker container
RUN git clone https://USER_NAME:PASSWORD@bitbucket.org/osasio/easylinkraspberry.git
WORKDIR /easylinkraspberry/
CMD [ "python", "-u", "./firebase.py" ] #asd4
linux embedded-linux docker-watchtower
add a comment |
I am running docker on raspberry pi zero, I am starting watchtower and my container using systemd at startup. my container it self just working if I run it with my hand or run by systemd at startup but when I push new image my private repo watchtower detects new version.. stops, removes and tries to run new version but at this point container exits with 137 immediately (after 3 secs running time).
here is the log of exited container:
pi@raspberrypi:~ $ sudo docker logs 6f2a4282cdfe
Systemd init system enabled.
systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
Detected virtualization 'other'.
Detected architecture 'arm'.
Set hostname to <fc6cd3bd9174>.
Failed to configure loopback device: Permission denied
Received SIGRTMIN+3.
here is the result of inspect command:
[
{
"Id": "e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7",
"Created": "2018-06-07T11:20:34.05859919Z",
"Path": "python",
"Args": [
"-u",
"./firebase.py"
],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 137,
"Error": "",
"StartedAt": "2018-06-07T11:20:41.950594496Z",
"FinishedAt": "2018-06-07T11:20:44.967301585Z"
},
"Image": "sha256:b88bb7323a0c74c54144521c0170b078df4282fe40bc124fd0cf1c5926d0584c",
"ResolvConfPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/hostname",
"HostsPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/hosts",
"LogPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7-json.log",
"Name": "/go-miner-container",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": ,
"DnsOptions": ,
"DnsSearch": ,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": true,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [
"label=disable"
],
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": ,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": ,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": null,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462-init/diff:/var/lib/docker/overlay2/938f7ab70c56b28e84d2444636d4bca2e8f41f82afb1423015f9bf768c788dd9/diff:/var/lib/docker/overlay2/db9771f2ad8ad54e0c07aab69bdd406e6a5f3e2a1abc3a5211a86fb2d509d970/diff:/var/lib/docker/overlay2/569fd809dceb91fc183a0022ae56495a3ef42d5ccf9cf520016aec7cb18918bd/diff:/var/lib/docker/overlay2/98d3eeec7feb2a4e8e6c8d392c73ae3119e0fa540b3782099d9530081960fa66/diff:/var/lib/docker/overlay2/d995e83a8c9b5a5255c82cc2ea99054d66a141af7a804d3894aebbcc96332f1f/diff:/var/lib/docker/overlay2/8e68793b217e1f5bd1788e3b94f17e15cdecc1b6464441d4d5dbee4058892ff0/diff:/var/lib/docker/overlay2/b100534660ed91a94e0e958241507487e13b89c2eb6745c8909979b4c31d8970/diff:/var/lib/docker/overlay2/ce783e4ff7bd08110d439e21791367779d55e39146f55295a658d908f4940975/diff:/var/lib/docker/overlay2/fc15200a4fe254c03f1598b03808f4072d3a4084a63f464b38001bea2ef89b35/diff:/var/lib/docker/overlay2/8a0500ec24f2b0ae05b55d40386f8d1566b32a1ee992a0e7482041648ab4ad30/diff:/var/lib/docker/overlay2/d2f9053d28f7a68e92e5fbb8a373b81d39b9d0168e104d7062d9b8bf3f4d5517/diff:/var/lib/docker/overlay2/8843a6d10e696375160435cc610e0b8ab91523739125bfb6dc8749188447f0be/diff:/var/lib/docker/overlay2/3680e27bc7f42b96e4ecb827fbefbf280c3b31412743723494c9608311889d14/diff:/var/lib/docker/overlay2/39b71a75d4c1aeef3e7fbc83b4778c030d04fefc4559cccab7a8b90f31f24049/diff:/var/lib/docker/overlay2/2cbe5685da3fa2b4c1b52e1eed93978ec4175bbc87ed77210700da08ddab4544/diff:/var/lib/docker/overlay2/bb29132edd2d7ca214d8edf8cb185319a2aa147052563b70a28f834dfb9c87da/diff:/var/lib/docker/overlay2/2f502551a2e74a16159820fd6aacd0c90d55bebc8c581fd1bbd46ab85b4201b5/diff:/var/lib/docker/overlay2/704c34d8f8978cee4485e65fa923f742666ebe8260872991fa8b08c56e7d3f9e/diff:/var/lib/docker/overlay2/214b24ce23b22631cf04b213fed09decc4b2fe08643ceedeecd98feb161d8ade/diff:/var/lib/docker/overlay2/2916cbe9887d1baf5f0d0345913dd6c7d7847a4e217520d261e36851f903ac91/diff:/var/lib/docker/overlay2/4af52cf964a3f100bc7ceec9e96f02b60305e8025556fce2a7e1bcbc399636db/diff:/var/lib/docker/overlay2/a15dba23f7c9f0ffb3c1de9497677862e8cd2adf7506f454b4d38671ca6b5815/diff:/var/lib/docker/overlay2/c6f4dffaf9c651828280cd80747659d2462db727aad47e04d68a25edfa5b9cd4/diff:/var/lib/docker/overlay2/db5507926c9564a2186bda441b3657ae2d7a6fc399df04eed7059be915e6554f/diff:/var/lib/docker/overlay2/9705a3a0d47e0cff848d4aa96f015438f6f30755fe5fc419e9cf6fef83af1c28/diff:/var/lib/docker/overlay2/25493cdc5e50330722910834a72ed517166129bc545eca5d0a2bd07a308ae6a8/diff:/var/lib/docker/overlay2/011396cec2412a73f8ae256fc084b7a3ef96e20f04d22ee06bc1e602005dca92/diff:/var/lib/docker/overlay2/7dbf65ddeff957b111e6b9223e178a597e1b3503236a38ab7dff80b96f0637d7/diff",
"MergedDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/merged",
"UpperDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/diff",
"WorkDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "464aa3db13b65151bc7ca0f264efc415a005548d53a94160b54e4fa1cb55e1f8",
"Source": "/var/lib/docker/volumes/464aa3db13b65151bc7ca0f264efc415a005548d53a94160b54e4fa1cb55e1f8/_data",
"Destination": "/sys/fs/cgroup",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "250a29950ccb",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"Tty": true,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TINI_VERSION=0.14.0",
"LC_ALL=C.UTF-8",
"DEBIAN_FRONTEND=noninteractive",
"UDEV=on",
"QEMU_CPU=arm1176",
"container=docker",
"LANG=C.UTF-8",
"PYTHON_VERSION=3.6.5",
"PYTHON_PIP_VERSION=10.0.1",
"SETUPTOOLS_VERSION=39.1.0",
"PYTHON_DBUS_VERSION=1.2.4",
"PYTHONPATH=/usr/lib/python3/dist-packages:",
"INITSYSTEM=on"
],
"Cmd": null,
"ArgsEscaped": true,
"Image": "beratuslu/gominer:latest",
"Volumes": {
"/sys/fs/cgroup": {}
},
"WorkingDir": "/easylinkraspberry",
"Entrypoint": [
"python",
"-u",
"./firebase.py"
],
"OnBuild": null,
"Labels": {
"io.resin.architecture": "rpi",
"io.resin.device-type": "raspberrypi",
"io.resin.qemu.version": ""
},
"StopSignal": "37"
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "129cc44fd27bb811e19a0c0635b9d387392a9c29c084c9cceaa106e278d8b7e3",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/129cc44fd27b",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "546d9919184787d41e3f1359400ee76cf244f3f298ce406fec5988a6e2c5dae0",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]
here watchtower systemd service:
[Unit]
Description=Watchtower container
Requires=network-online.target docker.service
After=docker.service
[Service]
Restart=never
ExecStartPre=-/usr/bin/docker rm -f watchtower
ExecStart=/usr/bin/docker run --name watchtower --rm -v /var/run/docker.sock:/var/run/docker.sock -e REPO_USER=USER_NAME -e REPO_PASS=PASSWORD v2tec/watchtower:armhf-latest -i 30 --cleanup --debug
ExecStop=/usr/bin/docker stop -t 2 watchtower
[Install]
WantedBy=default.target
here my-app systemd service:
[Unit]
Description=My App
Requires=network-online.target docker.service
After=docker.service
[Service]
# Don't restart, conflicts with Watchtower
Restart=never
ExecStartPre=-/usr/bin/docker rm -f go-miner-container
ExecStart=/usr/bin/docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
ExecStop=/usr/bin/docker stop -t 2 go-miner-container
[Install]
WantedBy=default.target
Here is my Docker file:
FROM resin/raspberry-pi-python:3.6.5-slim
MAINTAINER Berat USLU "berat_uslu@hotmail.com"
# Enable systemd
ENV INITSYSTEM on
# Your code goes here
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git
RUN apt-get install build-essential python-pip python-dev python-smbus python3-smbus
RUN git clone https://github.com/beratuslu/Pyrebase.git
WORKDIR /Pyrebase/
RUN python setup.py install
WORKDIR /
RUN git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
WORKDIR /Adafruit_Python_GPIO/
RUN python setup.py install
WORKDIR /
RUN pip install dictdiffer
RUN pip install smbus2
#RUN apt-get -y install python3-rpi.gpio
RUN pip install RPi.GPIO
# Clone the conf files into the docker container
RUN git clone https://USER_NAME:PASSWORD@bitbucket.org/osasio/easylinkraspberry.git
WORKDIR /easylinkraspberry/
CMD [ "python", "-u", "./firebase.py" ] #asd4
linux embedded-linux docker-watchtower
1
Can you show how you're actually running the container? YourDockerfile
does not appear to have aCMD
orENTRYPOINT
, which could cause your container to exit immediately
– brandon-barnett
Jun 9 '18 at 13:05
you can see it in my-app systemd service above.. docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
– beratuslu
Jun 9 '18 at 13:20
yes, sorry I see your point. it was copy/paste mistake. I added 2 lines at the end. excuse me above comment.
– beratuslu
Jun 9 '18 at 17:19
add a comment |
I am running docker on raspberry pi zero, I am starting watchtower and my container using systemd at startup. my container it self just working if I run it with my hand or run by systemd at startup but when I push new image my private repo watchtower detects new version.. stops, removes and tries to run new version but at this point container exits with 137 immediately (after 3 secs running time).
here is the log of exited container:
pi@raspberrypi:~ $ sudo docker logs 6f2a4282cdfe
Systemd init system enabled.
systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
Detected virtualization 'other'.
Detected architecture 'arm'.
Set hostname to <fc6cd3bd9174>.
Failed to configure loopback device: Permission denied
Received SIGRTMIN+3.
here is the result of inspect command:
[
{
"Id": "e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7",
"Created": "2018-06-07T11:20:34.05859919Z",
"Path": "python",
"Args": [
"-u",
"./firebase.py"
],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 137,
"Error": "",
"StartedAt": "2018-06-07T11:20:41.950594496Z",
"FinishedAt": "2018-06-07T11:20:44.967301585Z"
},
"Image": "sha256:b88bb7323a0c74c54144521c0170b078df4282fe40bc124fd0cf1c5926d0584c",
"ResolvConfPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/hostname",
"HostsPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/hosts",
"LogPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7-json.log",
"Name": "/go-miner-container",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": ,
"DnsOptions": ,
"DnsSearch": ,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": true,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [
"label=disable"
],
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": ,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": ,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": null,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462-init/diff:/var/lib/docker/overlay2/938f7ab70c56b28e84d2444636d4bca2e8f41f82afb1423015f9bf768c788dd9/diff:/var/lib/docker/overlay2/db9771f2ad8ad54e0c07aab69bdd406e6a5f3e2a1abc3a5211a86fb2d509d970/diff:/var/lib/docker/overlay2/569fd809dceb91fc183a0022ae56495a3ef42d5ccf9cf520016aec7cb18918bd/diff:/var/lib/docker/overlay2/98d3eeec7feb2a4e8e6c8d392c73ae3119e0fa540b3782099d9530081960fa66/diff:/var/lib/docker/overlay2/d995e83a8c9b5a5255c82cc2ea99054d66a141af7a804d3894aebbcc96332f1f/diff:/var/lib/docker/overlay2/8e68793b217e1f5bd1788e3b94f17e15cdecc1b6464441d4d5dbee4058892ff0/diff:/var/lib/docker/overlay2/b100534660ed91a94e0e958241507487e13b89c2eb6745c8909979b4c31d8970/diff:/var/lib/docker/overlay2/ce783e4ff7bd08110d439e21791367779d55e39146f55295a658d908f4940975/diff:/var/lib/docker/overlay2/fc15200a4fe254c03f1598b03808f4072d3a4084a63f464b38001bea2ef89b35/diff:/var/lib/docker/overlay2/8a0500ec24f2b0ae05b55d40386f8d1566b32a1ee992a0e7482041648ab4ad30/diff:/var/lib/docker/overlay2/d2f9053d28f7a68e92e5fbb8a373b81d39b9d0168e104d7062d9b8bf3f4d5517/diff:/var/lib/docker/overlay2/8843a6d10e696375160435cc610e0b8ab91523739125bfb6dc8749188447f0be/diff:/var/lib/docker/overlay2/3680e27bc7f42b96e4ecb827fbefbf280c3b31412743723494c9608311889d14/diff:/var/lib/docker/overlay2/39b71a75d4c1aeef3e7fbc83b4778c030d04fefc4559cccab7a8b90f31f24049/diff:/var/lib/docker/overlay2/2cbe5685da3fa2b4c1b52e1eed93978ec4175bbc87ed77210700da08ddab4544/diff:/var/lib/docker/overlay2/bb29132edd2d7ca214d8edf8cb185319a2aa147052563b70a28f834dfb9c87da/diff:/var/lib/docker/overlay2/2f502551a2e74a16159820fd6aacd0c90d55bebc8c581fd1bbd46ab85b4201b5/diff:/var/lib/docker/overlay2/704c34d8f8978cee4485e65fa923f742666ebe8260872991fa8b08c56e7d3f9e/diff:/var/lib/docker/overlay2/214b24ce23b22631cf04b213fed09decc4b2fe08643ceedeecd98feb161d8ade/diff:/var/lib/docker/overlay2/2916cbe9887d1baf5f0d0345913dd6c7d7847a4e217520d261e36851f903ac91/diff:/var/lib/docker/overlay2/4af52cf964a3f100bc7ceec9e96f02b60305e8025556fce2a7e1bcbc399636db/diff:/var/lib/docker/overlay2/a15dba23f7c9f0ffb3c1de9497677862e8cd2adf7506f454b4d38671ca6b5815/diff:/var/lib/docker/overlay2/c6f4dffaf9c651828280cd80747659d2462db727aad47e04d68a25edfa5b9cd4/diff:/var/lib/docker/overlay2/db5507926c9564a2186bda441b3657ae2d7a6fc399df04eed7059be915e6554f/diff:/var/lib/docker/overlay2/9705a3a0d47e0cff848d4aa96f015438f6f30755fe5fc419e9cf6fef83af1c28/diff:/var/lib/docker/overlay2/25493cdc5e50330722910834a72ed517166129bc545eca5d0a2bd07a308ae6a8/diff:/var/lib/docker/overlay2/011396cec2412a73f8ae256fc084b7a3ef96e20f04d22ee06bc1e602005dca92/diff:/var/lib/docker/overlay2/7dbf65ddeff957b111e6b9223e178a597e1b3503236a38ab7dff80b96f0637d7/diff",
"MergedDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/merged",
"UpperDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/diff",
"WorkDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "464aa3db13b65151bc7ca0f264efc415a005548d53a94160b54e4fa1cb55e1f8",
"Source": "/var/lib/docker/volumes/464aa3db13b65151bc7ca0f264efc415a005548d53a94160b54e4fa1cb55e1f8/_data",
"Destination": "/sys/fs/cgroup",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "250a29950ccb",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"Tty": true,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TINI_VERSION=0.14.0",
"LC_ALL=C.UTF-8",
"DEBIAN_FRONTEND=noninteractive",
"UDEV=on",
"QEMU_CPU=arm1176",
"container=docker",
"LANG=C.UTF-8",
"PYTHON_VERSION=3.6.5",
"PYTHON_PIP_VERSION=10.0.1",
"SETUPTOOLS_VERSION=39.1.0",
"PYTHON_DBUS_VERSION=1.2.4",
"PYTHONPATH=/usr/lib/python3/dist-packages:",
"INITSYSTEM=on"
],
"Cmd": null,
"ArgsEscaped": true,
"Image": "beratuslu/gominer:latest",
"Volumes": {
"/sys/fs/cgroup": {}
},
"WorkingDir": "/easylinkraspberry",
"Entrypoint": [
"python",
"-u",
"./firebase.py"
],
"OnBuild": null,
"Labels": {
"io.resin.architecture": "rpi",
"io.resin.device-type": "raspberrypi",
"io.resin.qemu.version": ""
},
"StopSignal": "37"
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "129cc44fd27bb811e19a0c0635b9d387392a9c29c084c9cceaa106e278d8b7e3",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/129cc44fd27b",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "546d9919184787d41e3f1359400ee76cf244f3f298ce406fec5988a6e2c5dae0",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]
here watchtower systemd service:
[Unit]
Description=Watchtower container
Requires=network-online.target docker.service
After=docker.service
[Service]
Restart=never
ExecStartPre=-/usr/bin/docker rm -f watchtower
ExecStart=/usr/bin/docker run --name watchtower --rm -v /var/run/docker.sock:/var/run/docker.sock -e REPO_USER=USER_NAME -e REPO_PASS=PASSWORD v2tec/watchtower:armhf-latest -i 30 --cleanup --debug
ExecStop=/usr/bin/docker stop -t 2 watchtower
[Install]
WantedBy=default.target
here my-app systemd service:
[Unit]
Description=My App
Requires=network-online.target docker.service
After=docker.service
[Service]
# Don't restart, conflicts with Watchtower
Restart=never
ExecStartPre=-/usr/bin/docker rm -f go-miner-container
ExecStart=/usr/bin/docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
ExecStop=/usr/bin/docker stop -t 2 go-miner-container
[Install]
WantedBy=default.target
Here is my Docker file:
FROM resin/raspberry-pi-python:3.6.5-slim
MAINTAINER Berat USLU "berat_uslu@hotmail.com"
# Enable systemd
ENV INITSYSTEM on
# Your code goes here
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git
RUN apt-get install build-essential python-pip python-dev python-smbus python3-smbus
RUN git clone https://github.com/beratuslu/Pyrebase.git
WORKDIR /Pyrebase/
RUN python setup.py install
WORKDIR /
RUN git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
WORKDIR /Adafruit_Python_GPIO/
RUN python setup.py install
WORKDIR /
RUN pip install dictdiffer
RUN pip install smbus2
#RUN apt-get -y install python3-rpi.gpio
RUN pip install RPi.GPIO
# Clone the conf files into the docker container
RUN git clone https://USER_NAME:PASSWORD@bitbucket.org/osasio/easylinkraspberry.git
WORKDIR /easylinkraspberry/
CMD [ "python", "-u", "./firebase.py" ] #asd4
linux embedded-linux docker-watchtower
I am running docker on raspberry pi zero, I am starting watchtower and my container using systemd at startup. my container it self just working if I run it with my hand or run by systemd at startup but when I push new image my private repo watchtower detects new version.. stops, removes and tries to run new version but at this point container exits with 137 immediately (after 3 secs running time).
here is the log of exited container:
pi@raspberrypi:~ $ sudo docker logs 6f2a4282cdfe
Systemd init system enabled.
systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
Detected virtualization 'other'.
Detected architecture 'arm'.
Set hostname to <fc6cd3bd9174>.
Failed to configure loopback device: Permission denied
Received SIGRTMIN+3.
here is the result of inspect command:
[
{
"Id": "e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7",
"Created": "2018-06-07T11:20:34.05859919Z",
"Path": "python",
"Args": [
"-u",
"./firebase.py"
],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 137,
"Error": "",
"StartedAt": "2018-06-07T11:20:41.950594496Z",
"FinishedAt": "2018-06-07T11:20:44.967301585Z"
},
"Image": "sha256:b88bb7323a0c74c54144521c0170b078df4282fe40bc124fd0cf1c5926d0584c",
"ResolvConfPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/hostname",
"HostsPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/hosts",
"LogPath": "/var/lib/docker/containers/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7/e826c0940dc224f7b041ad2861229435f3ff7b0c5b9810f432eab78a1182eba7-json.log",
"Name": "/go-miner-container",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": ,
"DnsOptions": ,
"DnsSearch": ,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": true,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [
"label=disable"
],
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": ,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": ,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": null,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462-init/diff:/var/lib/docker/overlay2/938f7ab70c56b28e84d2444636d4bca2e8f41f82afb1423015f9bf768c788dd9/diff:/var/lib/docker/overlay2/db9771f2ad8ad54e0c07aab69bdd406e6a5f3e2a1abc3a5211a86fb2d509d970/diff:/var/lib/docker/overlay2/569fd809dceb91fc183a0022ae56495a3ef42d5ccf9cf520016aec7cb18918bd/diff:/var/lib/docker/overlay2/98d3eeec7feb2a4e8e6c8d392c73ae3119e0fa540b3782099d9530081960fa66/diff:/var/lib/docker/overlay2/d995e83a8c9b5a5255c82cc2ea99054d66a141af7a804d3894aebbcc96332f1f/diff:/var/lib/docker/overlay2/8e68793b217e1f5bd1788e3b94f17e15cdecc1b6464441d4d5dbee4058892ff0/diff:/var/lib/docker/overlay2/b100534660ed91a94e0e958241507487e13b89c2eb6745c8909979b4c31d8970/diff:/var/lib/docker/overlay2/ce783e4ff7bd08110d439e21791367779d55e39146f55295a658d908f4940975/diff:/var/lib/docker/overlay2/fc15200a4fe254c03f1598b03808f4072d3a4084a63f464b38001bea2ef89b35/diff:/var/lib/docker/overlay2/8a0500ec24f2b0ae05b55d40386f8d1566b32a1ee992a0e7482041648ab4ad30/diff:/var/lib/docker/overlay2/d2f9053d28f7a68e92e5fbb8a373b81d39b9d0168e104d7062d9b8bf3f4d5517/diff:/var/lib/docker/overlay2/8843a6d10e696375160435cc610e0b8ab91523739125bfb6dc8749188447f0be/diff:/var/lib/docker/overlay2/3680e27bc7f42b96e4ecb827fbefbf280c3b31412743723494c9608311889d14/diff:/var/lib/docker/overlay2/39b71a75d4c1aeef3e7fbc83b4778c030d04fefc4559cccab7a8b90f31f24049/diff:/var/lib/docker/overlay2/2cbe5685da3fa2b4c1b52e1eed93978ec4175bbc87ed77210700da08ddab4544/diff:/var/lib/docker/overlay2/bb29132edd2d7ca214d8edf8cb185319a2aa147052563b70a28f834dfb9c87da/diff:/var/lib/docker/overlay2/2f502551a2e74a16159820fd6aacd0c90d55bebc8c581fd1bbd46ab85b4201b5/diff:/var/lib/docker/overlay2/704c34d8f8978cee4485e65fa923f742666ebe8260872991fa8b08c56e7d3f9e/diff:/var/lib/docker/overlay2/214b24ce23b22631cf04b213fed09decc4b2fe08643ceedeecd98feb161d8ade/diff:/var/lib/docker/overlay2/2916cbe9887d1baf5f0d0345913dd6c7d7847a4e217520d261e36851f903ac91/diff:/var/lib/docker/overlay2/4af52cf964a3f100bc7ceec9e96f02b60305e8025556fce2a7e1bcbc399636db/diff:/var/lib/docker/overlay2/a15dba23f7c9f0ffb3c1de9497677862e8cd2adf7506f454b4d38671ca6b5815/diff:/var/lib/docker/overlay2/c6f4dffaf9c651828280cd80747659d2462db727aad47e04d68a25edfa5b9cd4/diff:/var/lib/docker/overlay2/db5507926c9564a2186bda441b3657ae2d7a6fc399df04eed7059be915e6554f/diff:/var/lib/docker/overlay2/9705a3a0d47e0cff848d4aa96f015438f6f30755fe5fc419e9cf6fef83af1c28/diff:/var/lib/docker/overlay2/25493cdc5e50330722910834a72ed517166129bc545eca5d0a2bd07a308ae6a8/diff:/var/lib/docker/overlay2/011396cec2412a73f8ae256fc084b7a3ef96e20f04d22ee06bc1e602005dca92/diff:/var/lib/docker/overlay2/7dbf65ddeff957b111e6b9223e178a597e1b3503236a38ab7dff80b96f0637d7/diff",
"MergedDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/merged",
"UpperDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/diff",
"WorkDir": "/var/lib/docker/overlay2/f20d937621ab4301e8f85959ae660478473b0238976f5efa87dc8ee538ca5462/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "464aa3db13b65151bc7ca0f264efc415a005548d53a94160b54e4fa1cb55e1f8",
"Source": "/var/lib/docker/volumes/464aa3db13b65151bc7ca0f264efc415a005548d53a94160b54e4fa1cb55e1f8/_data",
"Destination": "/sys/fs/cgroup",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "250a29950ccb",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"Tty": true,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TINI_VERSION=0.14.0",
"LC_ALL=C.UTF-8",
"DEBIAN_FRONTEND=noninteractive",
"UDEV=on",
"QEMU_CPU=arm1176",
"container=docker",
"LANG=C.UTF-8",
"PYTHON_VERSION=3.6.5",
"PYTHON_PIP_VERSION=10.0.1",
"SETUPTOOLS_VERSION=39.1.0",
"PYTHON_DBUS_VERSION=1.2.4",
"PYTHONPATH=/usr/lib/python3/dist-packages:",
"INITSYSTEM=on"
],
"Cmd": null,
"ArgsEscaped": true,
"Image": "beratuslu/gominer:latest",
"Volumes": {
"/sys/fs/cgroup": {}
},
"WorkingDir": "/easylinkraspberry",
"Entrypoint": [
"python",
"-u",
"./firebase.py"
],
"OnBuild": null,
"Labels": {
"io.resin.architecture": "rpi",
"io.resin.device-type": "raspberrypi",
"io.resin.qemu.version": ""
},
"StopSignal": "37"
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "129cc44fd27bb811e19a0c0635b9d387392a9c29c084c9cceaa106e278d8b7e3",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/129cc44fd27b",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "546d9919184787d41e3f1359400ee76cf244f3f298ce406fec5988a6e2c5dae0",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]
here watchtower systemd service:
[Unit]
Description=Watchtower container
Requires=network-online.target docker.service
After=docker.service
[Service]
Restart=never
ExecStartPre=-/usr/bin/docker rm -f watchtower
ExecStart=/usr/bin/docker run --name watchtower --rm -v /var/run/docker.sock:/var/run/docker.sock -e REPO_USER=USER_NAME -e REPO_PASS=PASSWORD v2tec/watchtower:armhf-latest -i 30 --cleanup --debug
ExecStop=/usr/bin/docker stop -t 2 watchtower
[Install]
WantedBy=default.target
here my-app systemd service:
[Unit]
Description=My App
Requires=network-online.target docker.service
After=docker.service
[Service]
# Don't restart, conflicts with Watchtower
Restart=never
ExecStartPre=-/usr/bin/docker rm -f go-miner-container
ExecStart=/usr/bin/docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
ExecStop=/usr/bin/docker stop -t 2 go-miner-container
[Install]
WantedBy=default.target
Here is my Docker file:
FROM resin/raspberry-pi-python:3.6.5-slim
MAINTAINER Berat USLU "berat_uslu@hotmail.com"
# Enable systemd
ENV INITSYSTEM on
# Your code goes here
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git
RUN apt-get install build-essential python-pip python-dev python-smbus python3-smbus
RUN git clone https://github.com/beratuslu/Pyrebase.git
WORKDIR /Pyrebase/
RUN python setup.py install
WORKDIR /
RUN git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
WORKDIR /Adafruit_Python_GPIO/
RUN python setup.py install
WORKDIR /
RUN pip install dictdiffer
RUN pip install smbus2
#RUN apt-get -y install python3-rpi.gpio
RUN pip install RPi.GPIO
# Clone the conf files into the docker container
RUN git clone https://USER_NAME:PASSWORD@bitbucket.org/osasio/easylinkraspberry.git
WORKDIR /easylinkraspberry/
CMD [ "python", "-u", "./firebase.py" ] #asd4
linux embedded-linux docker-watchtower
linux embedded-linux docker-watchtower
edited Jan 1 at 14:29
Dominik
738823
738823
asked Jun 9 '18 at 11:29
beratusluberatuslu
5071824
5071824
1
Can you show how you're actually running the container? YourDockerfile
does not appear to have aCMD
orENTRYPOINT
, which could cause your container to exit immediately
– brandon-barnett
Jun 9 '18 at 13:05
you can see it in my-app systemd service above.. docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
– beratuslu
Jun 9 '18 at 13:20
yes, sorry I see your point. it was copy/paste mistake. I added 2 lines at the end. excuse me above comment.
– beratuslu
Jun 9 '18 at 17:19
add a comment |
1
Can you show how you're actually running the container? YourDockerfile
does not appear to have aCMD
orENTRYPOINT
, which could cause your container to exit immediately
– brandon-barnett
Jun 9 '18 at 13:05
you can see it in my-app systemd service above.. docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
– beratuslu
Jun 9 '18 at 13:20
yes, sorry I see your point. it was copy/paste mistake. I added 2 lines at the end. excuse me above comment.
– beratuslu
Jun 9 '18 at 17:19
1
1
Can you show how you're actually running the container? Your
Dockerfile
does not appear to have a CMD
or ENTRYPOINT
, which could cause your container to exit immediately– brandon-barnett
Jun 9 '18 at 13:05
Can you show how you're actually running the container? Your
Dockerfile
does not appear to have a CMD
or ENTRYPOINT
, which could cause your container to exit immediately– brandon-barnett
Jun 9 '18 at 13:05
you can see it in my-app systemd service above.. docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
– beratuslu
Jun 9 '18 at 13:20
you can see it in my-app systemd service above.. docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
– beratuslu
Jun 9 '18 at 13:20
yes, sorry I see your point. it was copy/paste mistake. I added 2 lines at the end. excuse me above comment.
– beratuslu
Jun 9 '18 at 17:19
yes, sorry I see your point. it was copy/paste mistake. I added 2 lines at the end. excuse me above comment.
– beratuslu
Jun 9 '18 at 17:19
add a comment |
1 Answer
1
active
oldest
votes
Somewhere in your Dockerfile
or in that docker run ...
command, you need to supply a CMD
or ENTRYPOINT
argument. You're building a container image that contains your app and dependencies but there's no actual application entrypoint defined so nothing runs, which is why your container immediately exits.
See the following for documentation:
- https://docs.docker.com/engine/reference/builder/#cmd
- https://docs.docker.com/engine/reference/builder/#entrypoint
yes sorry. it was a copy/paste error I added last 2 lines of Dockerfile
– beratuslu
Jun 9 '18 at 14:42
So I'm guessing theFailed to configure loopback device: Permission denied
error is being throw withinfirebase.py
, correct? Any idea which line is throwing?
– brandon-barnett
Jun 9 '18 at 14:53
No, this error not thrown from python. It is also coming from container and I can say there is no problem with the line "Failed to configure loopback device: Permission denied" line... because if I start the container manually it outputs same line but container just works. Something causing container "Received SIGRTMIN+3." but what? thats the question...
– beratuslu
Jun 9 '18 at 17:03
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50773799%2fdocker-container-exits-immediately-upon-run%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Somewhere in your Dockerfile
or in that docker run ...
command, you need to supply a CMD
or ENTRYPOINT
argument. You're building a container image that contains your app and dependencies but there's no actual application entrypoint defined so nothing runs, which is why your container immediately exits.
See the following for documentation:
- https://docs.docker.com/engine/reference/builder/#cmd
- https://docs.docker.com/engine/reference/builder/#entrypoint
yes sorry. it was a copy/paste error I added last 2 lines of Dockerfile
– beratuslu
Jun 9 '18 at 14:42
So I'm guessing theFailed to configure loopback device: Permission denied
error is being throw withinfirebase.py
, correct? Any idea which line is throwing?
– brandon-barnett
Jun 9 '18 at 14:53
No, this error not thrown from python. It is also coming from container and I can say there is no problem with the line "Failed to configure loopback device: Permission denied" line... because if I start the container manually it outputs same line but container just works. Something causing container "Received SIGRTMIN+3." but what? thats the question...
– beratuslu
Jun 9 '18 at 17:03
add a comment |
Somewhere in your Dockerfile
or in that docker run ...
command, you need to supply a CMD
or ENTRYPOINT
argument. You're building a container image that contains your app and dependencies but there's no actual application entrypoint defined so nothing runs, which is why your container immediately exits.
See the following for documentation:
- https://docs.docker.com/engine/reference/builder/#cmd
- https://docs.docker.com/engine/reference/builder/#entrypoint
yes sorry. it was a copy/paste error I added last 2 lines of Dockerfile
– beratuslu
Jun 9 '18 at 14:42
So I'm guessing theFailed to configure loopback device: Permission denied
error is being throw withinfirebase.py
, correct? Any idea which line is throwing?
– brandon-barnett
Jun 9 '18 at 14:53
No, this error not thrown from python. It is also coming from container and I can say there is no problem with the line "Failed to configure loopback device: Permission denied" line... because if I start the container manually it outputs same line but container just works. Something causing container "Received SIGRTMIN+3." but what? thats the question...
– beratuslu
Jun 9 '18 at 17:03
add a comment |
Somewhere in your Dockerfile
or in that docker run ...
command, you need to supply a CMD
or ENTRYPOINT
argument. You're building a container image that contains your app and dependencies but there's no actual application entrypoint defined so nothing runs, which is why your container immediately exits.
See the following for documentation:
- https://docs.docker.com/engine/reference/builder/#cmd
- https://docs.docker.com/engine/reference/builder/#entrypoint
Somewhere in your Dockerfile
or in that docker run ...
command, you need to supply a CMD
or ENTRYPOINT
argument. You're building a container image that contains your app and dependencies but there's no actual application entrypoint defined so nothing runs, which is why your container immediately exits.
See the following for documentation:
- https://docs.docker.com/engine/reference/builder/#cmd
- https://docs.docker.com/engine/reference/builder/#entrypoint
answered Jun 9 '18 at 13:53
brandon-barnettbrandon-barnett
41537
41537
yes sorry. it was a copy/paste error I added last 2 lines of Dockerfile
– beratuslu
Jun 9 '18 at 14:42
So I'm guessing theFailed to configure loopback device: Permission denied
error is being throw withinfirebase.py
, correct? Any idea which line is throwing?
– brandon-barnett
Jun 9 '18 at 14:53
No, this error not thrown from python. It is also coming from container and I can say there is no problem with the line "Failed to configure loopback device: Permission denied" line... because if I start the container manually it outputs same line but container just works. Something causing container "Received SIGRTMIN+3." but what? thats the question...
– beratuslu
Jun 9 '18 at 17:03
add a comment |
yes sorry. it was a copy/paste error I added last 2 lines of Dockerfile
– beratuslu
Jun 9 '18 at 14:42
So I'm guessing theFailed to configure loopback device: Permission denied
error is being throw withinfirebase.py
, correct? Any idea which line is throwing?
– brandon-barnett
Jun 9 '18 at 14:53
No, this error not thrown from python. It is also coming from container and I can say there is no problem with the line "Failed to configure loopback device: Permission denied" line... because if I start the container manually it outputs same line but container just works. Something causing container "Received SIGRTMIN+3." but what? thats the question...
– beratuslu
Jun 9 '18 at 17:03
yes sorry. it was a copy/paste error I added last 2 lines of Dockerfile
– beratuslu
Jun 9 '18 at 14:42
yes sorry. it was a copy/paste error I added last 2 lines of Dockerfile
– beratuslu
Jun 9 '18 at 14:42
So I'm guessing the
Failed to configure loopback device: Permission denied
error is being throw within firebase.py
, correct? Any idea which line is throwing?– brandon-barnett
Jun 9 '18 at 14:53
So I'm guessing the
Failed to configure loopback device: Permission denied
error is being throw within firebase.py
, correct? Any idea which line is throwing?– brandon-barnett
Jun 9 '18 at 14:53
No, this error not thrown from python. It is also coming from container and I can say there is no problem with the line "Failed to configure loopback device: Permission denied" line... because if I start the container manually it outputs same line but container just works. Something causing container "Received SIGRTMIN+3." but what? thats the question...
– beratuslu
Jun 9 '18 at 17:03
No, this error not thrown from python. It is also coming from container and I can say there is no problem with the line "Failed to configure loopback device: Permission denied" line... because if I start the container manually it outputs same line but container just works. Something causing container "Received SIGRTMIN+3." but what? thats the question...
– beratuslu
Jun 9 '18 at 17:03
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50773799%2fdocker-container-exits-immediately-upon-run%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you show how you're actually running the container? Your
Dockerfile
does not appear to have aCMD
orENTRYPOINT
, which could cause your container to exit immediately– brandon-barnett
Jun 9 '18 at 13:05
you can see it in my-app systemd service above.. docker run --name go-miner-container --privileged -t beratuslu/gominer:latest
– beratuslu
Jun 9 '18 at 13:20
yes, sorry I see your point. it was copy/paste mistake. I added 2 lines at the end. excuse me above comment.
– beratuslu
Jun 9 '18 at 17:19