Skip to content

Commit 7b082d9

Browse files
committed
add daemon.json with overlay2 to fix container startup issue
Added a daemon.json file to set "overlay2" as the storage driver and moved Docker’s data directory to /opt/docker-data. This change makes sure Docker starts properly on EMT OS. Also updated the spec file to install this config and copy any existing Docker data to the new location. Signed-off-by: Polmoorx Shiva Kumar <polmoorx.shiva.kumar@intel.com>
1 parent a15e3ab commit 7b082d9

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

SPECS/moby-engine/daemon.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"data-root": "/opt/docker-data",
3+
"storage-driver": "overlay2"
4+
}

SPECS/moby-engine/docker.service

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Type=notify
1111
# the default is not to use systemd for cgroups because the delegate issues still
1212
# exists and systemd currently does not support the cgroup feature set required
1313
# for containers run by docker
14+
ExecStartPre=/usr/bin/mkdir -p /opt/docker-data
1415
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --exec-opt native.cgroupdriver=systemd
1516
ExecReload=/bin/kill -s HUP $MAINPID
1617
TimeoutSec=0
@@ -44,4 +45,4 @@ Delegate=yes
4445
KillMode=process
4546

4647
[Install]
47-
WantedBy=multi-user.target
48+
WantedBy=multi-user.target

SPECS/moby-engine/moby-engine.signatures.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"Signatures": {
3-
"docker.service": "b150b3ce0947a65c655ed09dfe4e48b7464c60542f9f9902330288bbf87af38e",
3+
"daemon.json": "b4995b275fd2a7ffe2533360832f81b452c38b90e0bd1126d8af6e02fc6ed4a2",
4+
"docker.service": "0f46584cc59ffefa4ca0b59faacce68ed4c5af55fdee3c816f7f81bd65fa6ac2",
45
"docker.socket": "51a06786cae46bc63b7314c25d0bd5bb2e676120d80874b99e35bf60d0b0ffa8",
56
"moby-engine-25.0.3.tar.gz": "4cdb516f5d6f5caf8b3bcf93c2962277ba727cfd2d1620176a3bb0cf153b3590"
67
}

SPECS/moby-engine/moby-engine.spec

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: The open-source application container engine
44
Name: moby-engine
55
Version: 25.0.3
6-
Release: 13%{?dist}
6+
Release: 14%{?dist}
77
License: ASL 2.0
88
Group: Tools/Container
99
URL: https://mobyproject.org
@@ -13,6 +13,7 @@ Distribution: Azure Linux
1313
Source0: https://github.com/moby/moby/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
1414
Source1: docker.service
1515
Source2: docker.socket
16+
Source3: daemon.json
1617

1718
Patch0: CVE-2022-2879.patch
1819
Patch1: enable-docker-proxy-libexec-search.patch
@@ -103,11 +104,21 @@ mkdir -p %{buildroot}%{_unitdir}
103104
install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/docker.service
104105
install -p -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/docker.socket
105106

107+
mkdir -p -m 755 %{buildroot}%{_sysconfdir}/docker
108+
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/docker/daemon.json
109+
106110
%post
107111
if ! grep -q "^docker:" /etc/group; then
108112
groupadd --system docker
109113
fi
110114

115+
mkdir -p /opt/docker-data
116+
chmod 0700 /opt/docker-data
117+
118+
if [ -d /var/lib/docker ] && [ ! -d /opt/docker-data/image ]; then
119+
rsync -a /var/lib/docker/ /opt/docker-data/ 2>/dev/null || true
120+
fi
121+
111122
%preun
112123
%systemd_preun docker.service
113124

@@ -118,10 +129,16 @@ fi
118129
%license LICENSE NOTICE
119130
%{_bindir}/dockerd
120131
%{_libexecdir}/docker-proxy
132+
%dir /opt/docker-data
133+
%dir %{_sysconfdir}/docker
134+
%config(noreplace) %{_sysconfdir}/docker/daemon.json
121135
%{_sysconfdir}/*
122136
%{_unitdir}/*
123137

124138
%changelog
139+
* Tue Jul 28 2025 Polmoorx Shiva Kumar <polmoorx.shiva.kumar@intel.com> - 25.0.3-14
140+
- Add daemon.json with overlay2 to fix container startup issue
141+
125142
* Fri May 30 2025 Ranjan Dutta <ranjan.dutta@intel.com> - 25.0.3-13
126143
- merge from Azure Linux 3.0.20250521-3.0
127144
- Patch CVE-2025-30204

toolkit/imageconfigs/additionalconfigs/layout.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ PERSISTENT_BIND_PATHS+="
4949
# reporting-agent
5050
PERSISTENT_BIND_PATHS+="
5151
/etc/edge-node/metrics"
52+
# Docker persistent data directory
53+
PERSISTENT_BIND_PATHS+="
54+
/opt/docker-data"
55+
5256
export PERSISTENT_BIND_PATHS
5357

5458
export PERSISTENT_BIND_TARGET="/opt/.mount/persistence"

0 commit comments

Comments
 (0)