How to Fix Docker Daemon Not Starting on Boot in CoreOS (835.9.0)


1 views

In CoreOS 835.9.0, the Docker daemon operates differently from traditional Linux distributions. By design, CoreOS uses systemd socket activation for Docker, meaning the daemon only starts when a client first attempts to connect (like when you run docker ps). This is intentional for resource optimization in container-focused environments.

If you need Docker to run immediately at startup (for monitoring tools or other services that depend on it), you can override the default behavior:

# Create a systemd drop-in directory
sudo mkdir -p /etc/systemd/system/docker.socket.d

# Create override configuration
echo '[Socket]
ListenStream=
ListenStream=/var/run/docker.sock
SocketUser=root
SocketMode=0660
SocketGroup=docker
' | sudo tee /etc/systemd/system/docker.socket.d/10-early-start.conf

# Reload systemd and enable the service
sudo systemctl daemon-reload
sudo systemctl enable --now docker.service

After reboot, check if Docker is running:

# Check Docker service status
systemctl status docker

# Verify socket activation
systemctl status docker.socket

# Test Docker functionality
docker info

For automated CoreOS deployments, you can configure this through cloud-config:

#cloud-config

coreos:
  units:
    - name: docker.socket
      command: restart
      enable: true
      content: |
        [Socket]
        ListenStream=/var/run/docker.sock
        SocketMode=0660
        SocketUser=root
        SocketGroup=docker
    - name: docker.service
      command: restart
      enable: true
      drop-ins:
        - name: 10-early-start.conf
          content: |
            [Unit]
            Requires=docker.socket

Before implementing this change:

  • This increases system resource usage as Docker runs continuously
  • CoreOS updates may overwrite custom systemd configurations
  • Consider whether your use case truly requires Docker at boot

If issues persist:

# Check systemd logs
journalctl -u docker -u docker.socket -b

# Verify socket file permissions
ls -la /var/run/docker.sock

# Check for conflicting configurations
systemctl cat docker.service docker.socket

When working with CoreOS (specifically version 835.9.0), you might notice the Docker daemon doesn't automatically initialize during system startup. This differs from traditional Linux distributions where Docker typically runs as a persistent service. The CoreOS approach is more intentional - services are managed through systemd and often activated on-demand via socket activation.

First, let's verify the current status of Docker services:

systemctl status docker.socket
systemctl status docker.service

You'll likely see the socket is active but the service remains inactive until the first Docker command triggers it.

To make Docker start automatically at boot, we need to modify systemd configuration. Create or edit the following drop-in file:

sudo mkdir -p /etc/systemd/system/docker.service.d
sudo vim /etc/systemd/system/docker.service.d/10-autostart.conf

Add these contents:

[Unit]
Description=Docker persistent configuration

[Service]
Restart=always
StartLimitInterval=0

After creating the configuration, reload systemd and enable the service:

sudo systemctl daemon-reload
sudo systemctl enable docker.service
sudo systemctl start docker.service

Verify with:

systemctl is-enabled docker.service
ps -ef | grep docker

For CoreOS installations managed via cloud-config, you can add this to your configuration:

#cloud-config
coreos:
  units:
    - name: docker.service
      command: start
      enable: true
      content: |
        [Unit]
        Description=Docker persistent configuration
        [Service]
        Restart=always
        StartLimitInterval=0

If you encounter issues:

  • Check journal logs: journalctl -u docker.service
  • Verify socket activation: systemctl status docker.socket
  • Ensure no conflicting configurations exist in /etc/systemd/system/docker.service*