Bug 1130498 - The /etc/machine-id created by docker run does not match specification from machine-id(5)
Summary: The /etc/machine-id created by docker run does not match specification from m...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Vincent Batts
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2014-08-15 12:33 UTC by Jan Pazdziora
Modified: 2019-03-06 02:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-09-12 18:47:23 UTC

Attachments (Terms of Use)

Description Jan Pazdziora 2014-08-15 12:33:35 UTC
Description of problem:

Attempt to run systemd-tmpfiles --create in containers started under docker-1.1.2-9.el7.x86_64 complains about

[/usr/lib/tmpfiles.d/systemd.conf:26] Failed to replace specifiers: /var/log/journal/%m
[/usr/lib/tmpfiles.d/systemd.conf:28] Failed to replace specifiers: /run/log/journal/%m

Looking around documentation and code, the %m is supposed to get the id from /etc/machine-id, and that is supposed to be 32 bytes + newline, and systemd-tmpfiles checks that it is not longer.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. # docker run -ti rhel7 wc /etc/machine-id
2. # docker run -ti fedora:20 wc /etc/machine-id

Actual results:

 1  1 65 /etc/machine-id

Expected results:

 1  1 33 /etc/machine-id

Additional info:

Comment 2 Daniel Walsh 2014-08-16 09:58:37 UTC
systemd guys, is there any reason for this hard limit.  We want to set the /etc/machine-id to match the UUID of the docker container.  Docker sets it UUID to 64

Comment 3 Daniel Walsh 2014-09-12 18:47:23 UTC
systemd refuse to fix this, claim that this is a docker problem.  UUID should be 32 chars.

I don't see either side fixing this,

Comment 4 Jan Pazdziora 2014-09-14 11:10:08 UTC
Can't DOcker just put part of its UUID there?

Comment 5 Daniel Walsh 2014-09-15 11:49:26 UTC
The current patch working its way upstream is to set the container_uuid environment variable with the truncated UUID before starting systemd within the container.  According to documentation systemd is supposed to create /etc/machine-id if it does not exist and this environment variable is set.  I believe we have another bug report where systemd did not do this, but not sure what the problem is.

If you play with docker-1.2 in collider right now the container_uuid environment variable should be set.

Note You need to log in before you can comment on or make changes to this bug.