Skip to content

Commit 46d9f21

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 d8a3c54 commit 46d9f21

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
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/moby-engine.signatures.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"Signatures": {
3+
"daemon.json": "b4995b275fd2a7ffe2533360832f81b452c38b90e0bd1126d8af6e02fc6ed4a2",
34
"docker.service": "b150b3ce0947a65c655ed09dfe4e48b7464c60542f9f9902330288bbf87af38e",
45
"docker.socket": "51a06786cae46bc63b7314c25d0bd5bb2e676120d80874b99e35bf60d0b0ffa8",
56
"moby-engine-25.0.3.tar.gz": "4cdb516f5d6f5caf8b3bcf93c2962277ba727cfd2d1620176a3bb0cf153b3590"

SPECS/moby-engine/moby-engine.spec

Lines changed: 20 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,23 @@ 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 %{buildroot}/opt/docker-data
108+
chmod 0700 %{buildroot}/opt/docker-data
109+
110+
mkdir -p -m 755 %{buildroot}%{_sysconfdir}/docker
111+
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/docker/daemon.json
112+
106113
%post
107114
if ! grep -q "^docker:" /etc/group; then
108115
groupadd --system docker
109116
fi
110117

118+
mkdir -p /opt/docker-data
119+
chmod 0700 /opt/docker-data
120+
if [ -d /var/lib/docker ] && [ ! -d /opt/docker-data/image ]; then
121+
rsync -a /var/lib/docker/ /opt/docker-data/
122+
fi
123+
111124
%preun
112125
%systemd_preun docker.service
113126

@@ -118,10 +131,16 @@ fi
118131
%license LICENSE NOTICE
119132
%{_bindir}/dockerd
120133
%{_libexecdir}/docker-proxy
134+
%dir /opt/docker-data
135+
%dir %{_sysconfdir}/docker
136+
%config(noreplace) %{_sysconfdir}/docker/daemon.json
121137
%{_sysconfdir}/*
122138
%{_unitdir}/*
123139

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

0 commit comments

Comments
 (0)