Viscosity
logo-black
  • Data
    • Database Services
      • Performance Assessment
      • Proactive Healthcheck
      • Database Migration & Consolidation
      • Performance Tuning
    • Microsoft Services
      • Microsoft Azure Services
      • Microsoft SQL Server Services
      • Microsoft Gold Azure Partner
    • Oracle Services
      • Oracle Database 19c
      • RAC
      • GoldenGate
      • Data Guard
      • Oracle & SQL Database
    • Viscosity Remote Services
  • Apps
    • App Dev Services
    • Oracle APEX
    • Viscosity AMP
    • Viscosity-ai
    • Shane-ai
  • Cloud
    • Cloud Services
    • Hybrid Cloud
    • Viscosity Edge Cloud
    • Virtualization & Cloud Expertise
    • Microsoft Azure Services
  • Infrastructure
    • Infrastructure Services
    • Exadata
      • Exadata Resale & Services
    • Oracle Database Appliance
      • Oracle Database Appliance Resale & Services
      • ODA Health Checks
    • Zero Data Loss Recovery Appliance
    • VMware to KVM Migration
  • Events
    • Upcoming Events
    • Virtual Training
    • 2025 Past Events
    • 2024 Past Events
    • 2023 Past Events
    • 2022 Past Events
  • About
    • About Us
    • News
    • Blogs
    • Publications
    • Contact
Hit enter to search or ESC to close
ENGAGE WITH US

Docker , Oracle on Docker , Linux Containers

Docker Service Startup Failure When Using A Custom Docker Directory on Linux

By Sean Scott
April 07, 2023

On Linux, you can change where Docker persists its resources from /var/lib/docker to a different directory. This directory contains all of your images, container layers, and volumes, and if your boot volume is small, Docker can quickly dominate the disk.

 

Most references I’ve seen tell you to update the location by editing the /lib/systemd/system/docker.service configuration file and change the following line:

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

…by adding an entry with the -g or --graph flag:

 

ExecStart=/usr/bin/dockerd -g /docker -H fd:// --containerd=/run/containerd/containerd.sock

 

Indeed, that works for versions before 17.05. However, in versions 17.05 and later, the -g and --graph options are deprecated. After updating Docker and restarting the service or host, you’ll see this error:

# systemctl start docker

● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Sat 2023-03-25 14:17:09 GMT; 997ms ago
Docs: https://docs.docker.com
Process: 1701 ExecStart=/usr/bin/dockerd -g /docker/.docker -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 1701 (code=exited, status=1/FAILURE)
Mar 25 14:17:07 docker systemd[1]: Failed to start Docker Application Container Engine.
Mar 25 14:17:07 docker systemd[1]: Unit docker.service entered failed state.
Mar 25 14:17:07 docker systemd[1]: docker.service failed.
Mar 25 14:17:09 docker systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 25 14:17:09 docker systemd[1]: Stopped Docker Application Container Engine.
Mar 25 14:17:09 docker systemd[1]: start request repeated too quickly for docker.service
Mar 25 14:17:09 docker systemd[1]: Failed to start Docker Application Container Engine.
Mar 25 14:17:09 docker systemd[1]: Unit docker.service entered failed state.
Mar 25 14:17:09 docker systemd[1]: docker.service failed.

Or:

# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Sat 2023-03-25 14:28:01 GMT; 42s ago
Docs: https://docs.docker.com
Process: 5168 ExecStart=/usr/bin/dockerd -g /docker/.docker -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 5168 (code=exited, status=1/FAILURE)

Mar 25 14:27:59 docker systemd[1]: Failed to start Docker Application Container Engine.
Mar 25 14:27:59 docker systemd[1]: Unit docker.service entered failed state.
Mar 25 14:27:59 docker systemd[1]: docker.service failed.
Mar 25 14:28:01 docker systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 25 14:28:01 docker systemd[1]: Stopped Docker Application Container Engine.
Mar 25 14:28:01 docker systemd[1]: start request repeated too quickly for docker.service
Mar 25 14:28:01 docker systemd[1]: Failed to start Docker Application Container Engine.
Mar 25 14:28:01 docker systemd[1]: Unit docker.service entered failed state.
Mar 25 14:28:01 docker systemd[1]: docker.service failed.

Or:

# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2023-03-25 14:28:56 GMT; 1s ago
Docs: https://docs.docker.com
Process: 5467 ExecStart=/usr/bin/dockerd -g /docker/.docker -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 5467 (code=exited, status=1/FAILURE)

Mar 25 14:28:56 docker systemd[1]: Failed to start Docker Application Container Engine.
Mar 25 14:28:56 docker systemd[1]: Unit docker.service entered failed state.
Mar 25 14:28:56 docker systemd[1]: docker.service failed.

 

The status output will lead you to the cause. Check journalctl -xe and within a few lines you’ll see a message indicating that use of the —-graph flag is deprecated and to instead use —-data-root:

# journalctl -xe
<snip>
-- Unit docker.service has begun starting up.
Mar 25 14:28:58 docker dockerd[5480]: Flag --graph has been deprecated, Use --data-root instead
Mar 25 14:28:58 docker dockerd[5480]: the "graph" config file option is deprecated; use "data-root" instead
Mar 25 14:28:58 docker systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 25 14:28:58 docker systemd[1]: Failed to start Docker Application Container Engine.

After changing the entry in /lib/systemd/system/docker.service to use the proper flag, Docker once again recognizes the non-default directory and starts normally.
ExecStart=/usr/bin/dockerd --data-root /docker -H fd:// --containerd=/run/containerd
/containerd.sock

 
All posts
About Author
Sean Scott

Sean is an Oracle ACE Director, Oracle Cloud Infrastructure Certified Architect Professional, and Oracle Autonomous Database Certified Specialist. He's a Managing Principal Consultant with Viscosity North America, where he designs highly available and scalable databases, leads database modernization and migration projects, and coaches database teams on their journeys toward DevOps and automation. Sean is a featured speaker at user group conferences and events around the world and author of the Apress book, "Oracle on Docker: Running Oracle Databases in Linux Containers."

You might also like
How to Pull Images From Oracle's Container Registry
How to Pull Images From Oracle's Container Registry
April 07, 2023
Run Oracle 23c On-Premises NOW
Run Oracle 23c On-Premises NOW
April 07, 2023
SUBMIT YOUR COMMENT
logo for footer

Viscosity's core expertise includes:

Data Transformation, Emerging Technology, High Availability & Scalability Solutions, Cloud Migrations, Performance Tuning, Data Integrations, Machine Learning, APEX Development, and Custom Application Development.


Solutions

Resources

Partnerships

Careers

Clients

 

Contact
Email: sales@viscosityna.com

Telephone:
(469) 444-1380

Address:
3016 Communications Pkwy Suite 200, Plano, TX 75093

Copyright 2025. All Rights Reserved by Viscosity North America.