Service docker start not work(daemon), ubuntu-15.10, To run dockerfile with intelliJ - linux

I have installed docker on ubuntu 15.10 but it does not start, these are the console outputs, I'm new with this from docker, try installing docker from this tutorial https://tecadmin.net/install-and-manage-docker-on-ubuntu/
My interest is to be able to run my dockerfile from intellij
service docker start
root#rubnPC:/var/lib/docker# service docker start
Job for docker.service failed because the control process exited with error
code. See "systemctl status docker.service" and "journalctl -xe" for details.
systemctl status docker.service
root#rubnPC:/var/lib/docker# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset:
enabled)
Active: failed (Result: exit-code) since sáb 2017-06-03 18:24:42 VET; 3min
18s ago
Docs: https://docs.docker.com
Process: 21270 ExecStart=/usr/bin/dockerd -H fd:// (code=exited,
status=1/FAILURE)
Main PID: 21270 (code=exited, status=1/FAILURE)
jun 03 18:24:42 rubnPC systemd[1]: Starting Docker Application Container
Engine...
jun 03 18:24:42 rubnPC dockerd[21270]: time="2017-06-03T18:24:42.614560352-
04:30" le...id"
jun 03 18:24:42 rubnPC systemd[1]: docker.service: Main process exited,
code=exited,...URE
jun 03 18:24:42 rubnPC systemd[1]: Failed to start Docker Application
Container Engine.
jun 03 18:24:42 rubnPC systemd[1]: docker.service: Unit entered failed
state.
jun 03 18:24:42 rubnPC systemd[1]: docker.service: Failed with result 'exit-
code'.
Hint: Some lines were ellipsized, use -l to show in full.
journalctl -xe
root#rubnPC:/var/lib/docker# journalctl -xe
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has begun starting up.
jun 03 18:24:42 rubnPC dockerd[21270]: time="2017-06-03T18:24:42.614560352-
04:30" level=fa
jun 03 18:24:42 rubnPC systemd[1]: docker.service: Main process exited,
code=exited, statu
jun 03 18:24:42 rubnPC systemd[1]: Failed to start Docker Application
Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
jun 03 18:24:42 rubnPC systemd[1]: docker.service: Unit entered failed
state.
jun 03 18:24:42 rubnPC systemd[1]: docker.service: Failed with result 'exit-
code'.
jun 03 18:24:42 rubnPC polkitd(authority=local)[865]: Unregistered
Authentication Agent fo
jun 03 18:31:24 rubnPC polkitd(authority=local)[865]: Registered
Authentication Agent for
jun 03 18:31:24 rubnPC systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has finished starting up.
System-Info
rubn _> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily
Docker version
rubn _> docker version
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Tue Jan 10 20:32:39 2017
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this
host?
Kernel Version
rubn _> uname -a
Linux rubnPC 4.2.0-42-generic #49-Ubuntu SMP Tue Jun 28 21:26:26 UTC 2016
x86_64 x86_64 x86_64 GNU/Linux
UPDATE: dockerfile
# Set the WILDFLY_VERSION env variable ENV WILDFLY_VERSION 10.0.0.Final ENV WILDFLY_SHA1 c0dd7552c5207b0d116a9c25eb94d10b4f375549
ENV JBOSS_HOME /opt/jboss/wildfly
# Add the WildFly distribution to /opt, and make wildfly the owner of the extracted tar content
# Make sure the distribution is available from a well-known place
RUN cd $HOME \
&& curl -O https://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz \
&& sha1sum wildfly-$WILDFLY_VERSION.tar.gz | grep $WILDFLY_SHA1 \
&& tar xf wildfly-$WILDFLY_VERSION.tar.gz \
&& mv $HOME/wildfly-$WILDFLY_VERSION $JBOSS_HOME \
&& rm wildfly-$WILDFLY_VERSION.tar.gz
# Ensure signals are forwarded to the JVM process correctly for graceful shutdown
ENV LAUNCH_JBOSS_IN_BACKGROUND true
# Expose the ports we're interested in
EXPOSE 8080
# Set the default command to run on boot
# This will boot WildFly in the standalone mode and bind to all interface
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]
ADD ROOT.war /opt/jboss/wildfly/standalone/deployments/
/etc/default/docker
# Docker Upstart and SysVinit configuration file
#
# THIS FILE DOES NOT APPLY TO SYSTEMD
#
# Please see the documentation for "systemd drop-ins":
# https://docs.docker.com/engine/articles/systemd/
#
# Customize location of Docker binary (especially for development testing).
#DOCKERD="/usr/local/bin/dockerd"
# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"
Solved
Docker can't connect to docker daemon

Can you post the contents of /etc/default/docker?
It seems you have invalid content that is failing the startup. I'm guessing you have fd:// in it. If you do, just remove that & then try restarting docker just as before.

Related

Docker Issue - Failed to start Docker Application Container Engine (code=exited, status=1/FAILURE)

I am fairly new to docker and linux and I am having issue installing and running docker. My system config are
Operating System: Debian GNU/Linux 9 (stretch)
Kernel: Linux 5.13.9.rsk.1-amd64
Architecture: x86-64
I followed official instructions. When I run sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin, it had following error
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-compose-plugin
I also tried, sudo systemctl restart docker, which output
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
Then I tried, sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2022-06-10 23:04:17 CST; 1min 41s ago
Docs: https://docs.docker.com
Main PID: 33878 (code=exited, status=1/FAILURE)
CPU: 111ms
Jun 10 23:04:15 6969-69-696 systemd[1]: docker.service: Unit entered failed state.
Jun 10 23:04:15 6969-69-696 systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 10 23:04:17 6969-69-696 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jun 10 23:04:17 6969-69-696 systemd[1]: Stopped Docker Application Container Engine.
Jun 10 23:04:17 6969-69-696 systemd[1]: docker.service: Start request repeated too quickly.
Jun 10 23:04:17 6969-69-696 systemd[1]: Failed to start Docker Application Container Engine.
Jun 10 23:04:17 6969-69-696 systemd[1]: docker.service: Unit entered failed state.
Jun 10 23:04:17 6969-69-696 systemd[1]: docker.service: Failed with result 'exit-code'.
journalctl -xe had a very big output which does not seem related to docker (most outputs are Failed to get GPU/HCU type or it is not a GPU/HCU host which would make sense since it is a remote host machine).
I have looked at other similar questions on stackoverflow and those fixes have not worked for me so far. Please let me know if I should be doing something differently or how can I fix it. I really need to get docker running for my work. Any help will be appreciated.

Run the program with Docker

I want to run the program on a VPS server Ubuntu 18.04. It must be run with Docker with this command:
docker run --rm --name aparser -v $(pwd)/aparser:/app -p 9091:9091 -t aparser/runtime./aparser -foreground
But I get an error:
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
Inputting
sudo systemctl status docker.service
I get:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-05-25 09:31:14 UTC; 14min ago
Docs: https://docs.docker.com
Process: 30302 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1 Main PID: 30302 (code=exited, status=1/FAILURE)
May 25 09:31:12 p619677.vps systemd[1]: docker.service: Main process exited,code=exited, status=1/FAILURE
May 25 09:31:12 p619677.vps systemd[1]: docker.service: Failed with result 'exit-code'.
May 25 09:31:12 p619677.vps systemd[1]: Failed to start Docker Application Container Engine.
May 25 09:31:14 p619677.vps systemd[1]: docker.service: Service hold-off time over, scheduling restart.
May 25 09:31:14 p619677.vps systemd[1]: docker.service: Scheduled restart job, restart counter is at 5.
May 25 09:31:14 p619677.vps systemd[1]: Stopped Docker Application Container Engine.
May 25 09:31:14 p619677.vps systemd[1]: docker.service: Start request repeated too quickly.
May 25 09:31:14 p619677.vps systemd[1]: docker.service: Failed with result 'exit-code'.
May 25 09:31:14 p619677.vps systemd[1]: Failed to start Docker Application Container Engine.
lines 1-16/16 (END)
You will run docker daemon before run docker container.
Run command for start docker service
sudo systemctl start docker
After starting docker you can run with your command and sudo if you are not in sudo
sudo docker run --rm --name aparser -v $(pwd)/aparser:/app -p 9091:9091 -t aparser/runtime./aparser -foreground
If systemctl not working for you run
sudo service docker start
This server does not support Docker.

Docker service hosts config failed to start

I have Debian 10 virtual machine.
And I want to be able to connect to the docker API from another host.
I can connect to docker from other host if I start docker deamon from console
dockerd -H unix:///var/run/docker.sock -H tcp://192.168.3.157
If I try to configure /etc/docker/daemon.json like
{
"hosts": ["unix:///var/run/docker.sock", "tcp://192.168.3.157"]
}
The command systemctl start docker fails. The command systemctl status docker have next output
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2019-11-02 11:32:26 MSK; 1min 10s ago
Docs: https://docs.docker.com
Process: 868 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 868 (code=exited, status=1/FAILURE)
Nov 02 11:32:24 debian-for-docker systemd[1]: Failed to start Docker Application Container Engine.
Nov 02 11:32:26 debian-for-docker systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
Nov 02 11:32:26 debian-for-docker systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Nov 02 11:32:26 debian-for-docker systemd[1]: Stopped Docker Application Container Engine.
Nov 02 11:32:26 debian-for-docker systemd[1]: docker.service: Start request repeated too quickly.
Nov 02 11:32:26 debian-for-docker systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 02 11:32:26 debian-for-docker systemd[1]: Failed to start Docker Application Container Engine.
Nov 02 11:32:53 debian-for-docker systemd[1]: docker.service: Start request repeated too quickly.
Nov 02 11:32:53 debian-for-docker systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 02 11:32:53 debian-for-docker systemd[1]: Failed to start Docker Application Container Engine.
How should I configure the /etc/docker/daemon.json to make my deamon start properly?
I have found the answer.
It's here Unable to start docker after configuring hosts in daemon.json
I have created the file /etc/systemd/system/docker.service.d/override.conf with content
# Disable flags to dockerd, all settings are done in /etc/docker/daemon.json
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
And then I restarted the service systemctl daemon-reload; systemctl restart docker

Docker start failed in centos 7

Docker service running on Centos 7 failed to start, I have some docker images which I want to save at any cost. I have searched a couple of online docs and they all say to delete /var/lib/docker/ dir which I don't want to because all the images and containers stuff is there. Can someone please save me how to get docker back up and running with losing any data.
Log:
[root#BuyPandGDev01 /]# systemctl status docker.service -l
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2018-04-22 00:05:23 UTC; 19min ago
Docs: http://docs.docker.com
Process: 1539 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
Main PID: 1539 (code=exited, status=1/FAILURE)
Apr 22 00:05:22 BuyPandGDev01 systemd[1]: Starting Docker Application Container Engine...
Apr 22 00:05:22 BuyPandGDev01 dockerd-current[1539]: time="2018-04-22T00:05:22.068920976Z" level=info msg="libcontainerd: new containerd process, pid: 1550"
Apr 22 00:05:23 BuyPandGDev01 dockerd-current[1539]: time="2018-04-22T00:05:23.101036303Z" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section."
Apr 22 00:05:23 BuyPandGDev01 dockerd-current[1539]: time="2018-04-22T00:05:23.155223108Z" level=error msg="[graphdriver] prior storage driver \"devicemapper\" failed: devmapper: Base Device UUID and Filesystem verification failed: devicemapper: Error running deviceCreate (ActivateDevice) dm_task_run failed"
Apr 22 00:05:23 BuyPandGDev01 dockerd-current[1539]: time="2018-04-22T00:05:23.155708413Z" level=fatal msg="Error starting daemon: error initializing graphdriver: devmapper: Base Device UUID and Filesystem verification failed: devicemapper: Error running deviceCreate (ActivateDevice) dm_task_run failed"
Apr 22 00:05:23 BuyPandGDev01 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 22 00:05:23 BuyPandGDev01 systemd[1]: Failed to start Docker Application Container Engine.
Apr 22 00:05:23 BuyPandGDev01 systemd[1]: Unit docker.service entered failed state.
Apr 22 00:05:23 BuyPandGDev01 systemd[1]: docker.service failed.
journalctl -xe:
[root#BuyPandGDev01 /]# journalctl -xe
-- Unit docker-storage-setup.service has begun starting up.
Apr 22 00:25:58 BuyPandGDev01 container-storage-setup[2111]: INFO: Volume group backing root filesystem could not be determined
Apr 22 00:25:58 BuyPandGDev01 container-storage-setup[2111]: ERROR: No valid volume group found. Exiting.
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: docker-storage-setup.service: main process exited, code=exited, status=1/FAILURE
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: Failed to start Docker Storage Setup.
-- Subject: Unit docker-storage-setup.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker-storage-setup.service has failed.
--
-- The result is failed.
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: Unit docker-storage-setup.service entered failed state.
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: docker-storage-setup.service failed.
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has begun starting up.
Apr 22 00:25:58 BuyPandGDev01 dockerd-current[2140]: time="2018-04-22T00:25:58.731142431Z" level=info msg="libcontainerd: new containe
Apr 22 00:25:59 BuyPandGDev01 dockerd-current[2140]: time="2018-04-22T00:25:59.767061431Z" level=warning msg="devmapper: Usage of loop
Apr 22 00:25:59 BuyPandGDev01 kernel: device-mapper: table: 253:1: thin: Couldn't open thin internal device
Apr 22 00:25:59 BuyPandGDev01 kernel: device-mapper: ioctl: error adding target to table
Apr 22 00:25:59 BuyPandGDev01 dockerd-current[2140]: time="2018-04-22T00:25:59.835261589Z" level=error msg="[graphdriver] prior storag
Apr 22 00:25:59 BuyPandGDev01 dockerd-current[2140]: time="2018-04-22T00:25:59.835697590Z" level=fatal msg="Error starting daemon: err
Apr 22 00:25:59 BuyPandGDev01 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 22 00:25:59 BuyPandGDev01 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Apr 22 00:25:59 BuyPandGDev01 systemd[1]: Unit docker.service entered failed state.
Apr 22 00:25:59 BuyPandGDev01 systemd[1]: docker.service failed.
Apr 22 00:25:59 BuyPandGDev01 polkitd[703]: Unregistered Authentication Agent for unix-process:2105:147803 (system bus name :1.43, obj
lines 2751-2788/2788 (END)
Any response would be helpful and appreciated.
Thx,
kumar
This error occurred for me when I was upgrading docker. Solution that worked for me was to remove legacy docker files /var/lib/docker/ and restart the docker service. Here is the solution.
# Remove docker files
$ rm -rf /var/lib/docker/
# Restart docker via service or via systemctl
$ service docker restart
$ service docker status
$ systemctl start docker.service
$ systemctl status docker.service
I had this error also starting the docker service:
kernel: device-mapper: table: 253:1: thin: Couldn't open thin internal device
I fixed it by creating a soft link from /var/lib/docker to another location on the machine which had more disk space.
cd /var/lib/
mv docker docker.old
ln -s /path/to/big/disk/docker/ docker
Restart the service:
systemctl restart docker

CentOS 7.0 docker fail to start service

I work with CentOS 7.0, and trying to configure docker, i used yum install docker for the docker installation.
when I start docker service, meets the follow problems:
[root#kiiby2r3 ~]# systemctl start docker.service
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
[root#kiiby2r3 ~]# systemctl status docker.service -l
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
Active: failed (Result: timeout) since Sun 2015-11-08 12:52:13 CST; 1h 3min ago
Docs: http://docs.docker.com
Main PID: 30368
Nov 08 12:48:35 kiiby2r3 docker[30368]: time="2015-11-08T12:48:35.968317600+08:00" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)"
Nov 08 12:48:36 kiiby2r3 docker[30368]: time="2015-11-08T12:48:36.028124500+08:00" level=error msg="WARNING: No --storage-opt dm.thinpooldev specified, using loopback; this configuration is strongly discouraged for production use"
Nov 08 12:49:34 kiiby2r3 systemd[1]: docker.service operation timed out. Terminating.
Nov 08 12:51:04 kiiby2r3 systemd[1]: docker.service stopping timed out (2). Killing.
Nov 08 12:52:13 kiiby2r3 systemd[1]: Failed to start Docker Application Container Engine.
Nov 08 12:52:14 kiiby2r3 systemd[1]: Unit docker.service entered failed state.
The CentOS release version:
[root#kiiby2r3 ~]# uname -a
Linux kiiby2r3 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root#kiiby2r3 ~]# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)
Can somebody give me a hint?
Thank you!

Resources