RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1465968 - docker run requires the --hostname option to be passed as first argument.
Summary: docker run requires the --hostname option to be passed as first argument.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: doc-Using-Containerized-Identity-Management-Services
Version: 7.4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Aneta Šteflová Petrová
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-28 14:35 UTC by Thorsten Scherf
Modified: 2019-03-06 01:14 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-23 07:26:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Thorsten Scherf 2017-06-28 14:35:26 UTC
Description of problem:
# atomic install rhel7/ipa-server --setup-dns --hostname ipa.dsal.lab.eng.bos.redhat.com
[...]
docker run -ti --rm --privileged -v /:/host -e HOST=/host -e DATADIR=/var/lib/ipa-server -e NAME=ipa-server -e IMAGE=rhel7/ipa-server rhel7/ipa-server /bin/install.sh --setup-dns --hostname ipa.dsal.lab.eng.bos.redhat.com
+ chroot /host /usr/bin/docker run -ti --rm --name ipa-server -e NAME=ipa-server -e IMAGE=rhel7/ipa-server -v /var/lib/ipa-server:/data:Z -v /sys/fs/cgroup:/sys/fs/cgroup:ro --tmpfs /run --tmpfs /tmp -v /dev/urandom:/dev/random:ro rhel7/ipa-server exit-on-finished --setup-dns --hostname ipa.dsal.lab.eng.bos.redhat.com
systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization docker.
Detected architecture x86-64.
Set hostname to <1acb9d0f9381>.
Initializing machine ID from random generator.
Wed Jun 28 14:27:22 UTC 2017 /usr/sbin/ipa-server-configure-first 
The container has to have fully-qualified hostname defined.

vs

# atomic install --name ipa-server rhel7/ipa-server --hostname ipa.dsal.lab.eng.bos.redhat.com --setup-dns
[...]
docker run -ti --rm --privileged -v /:/host -e HOST=/host -e DATADIR=/var/lib/ipa-server -e NAME=ipa-server -e IMAGE=rhel7/ipa-server rhel7/ipa-server /bin/install.sh --hostname ipa.dsal.lab.eng.bos.redhat.com --setup-dns
+ chroot /host /usr/bin/docker run -ti --rm --name ipa-server -e NAME=ipa-server -e IMAGE=rhel7/ipa-server -v /var/lib/ipa-server:/data:Z -v /sys/fs/cgroup:/sys/fs/cgroup:ro --tmpfs /run --tmpfs /tmp -v /dev/urandom:/dev/random:ro -h ipa.dsal.lab.eng.bos.redhat.com rhel7/ipa-server exit-on-finished --setup-dns
systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization docker.
Detected architecture x86-64.
Set hostname to <ipa.dsal.lab.eng.bos.redhat.com>.
Initializing machine ID from random generator.
Wed Jun 28 14:30:06 UTC 2017 /usr/sbin/ipa-server-configure-first 

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.
[...]

The order in which ipa-server-install options are passed to the atomic command should really matter. Or we need to explicitly document it.

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

# atomic images version docker.io/rhel7/ipa-server
IMAGE NAME                                 VERSION   IMAGE ID  
docker.io/rhel7/ipa-server:latest          4.4.0-43  1597cd9c2761

# atomic host status
State: idle
Deployments:
  atomic-host:rhel-atomic-host/7/x86_64/standard
             Version: 7.4.0 (2017-04-28 00:37:19)
              Commit: a235ce70ad4f5b7306d995e1f92308f535d1723e520cb3f6d853005cbebab081
              OSName: atomic-host


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Martin Bašti 2017-07-03 10:59:31 UTC
Thank you for reporting this. It looks that we overlooked this from user perspective.

The --hostname parameter must be first. It is actually "docker keyword", --hostname option in meaning ipa-server-install option is ignored because we cannot change hostname in non-privileged container.

Usage:
atomic install [ --name $THE_NAME ] rhel7/ipa-server [ keywords for docker operation ] [ ipa-server-install | ipa-replica-install ] [ opts ]

Example:
atomic install rhel7/ipa-server --hostname=FQDN ipa-server-install --setup-dns

Aneta we should explicitly document this in the guide IMO.

Comment 3 Aneta Šteflová Petrová 2017-07-03 12:42:29 UTC
Will it help if I add this sentence to the guide?

    "Use --hostname as the first parameter before any Identity Management options."

It could fit well into the Note about --hostname we have in every installation procedure: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7.4-beta/html-single/using_containerized_identity_management_services/#deploying-server-installing-an-identity-management-server-in-a-container-basic


Also, just to be sure: Are examples like this one okay? Can --hostname come after publish?

    atomic install rhel7/ipa-server publish --hostname fully_qualified_domain_name

Comment 4 Martin Bašti 2017-07-12 12:28:11 UTC
Maybe we should be more clear that we actually supports two types of options, atomic/docker related options and IdM installer options and explicitly mention that --hostname is ignored in case when used as installer option.

Maybe would be nice to add ipa-server-install into examples and just say that this is default operation and may be ommited

Also I found that examples with ipa-replica-install have wrong position of --hostname option

Comment 5 Aneta Šteflová Petrová 2017-07-17 08:32:02 UTC
(In reply to Martin Bašti from comment #4)
> Maybe we should be more clear that we actually supports two types of
> options, atomic/docker related options and IdM installer options and
> explicitly mention that --hostname is ignored in case when used as installer
> option.

The document now lists two types of options: Atomic options and Identity Management installer options ("Before You Start" in the installation procedures).

--hostname being ignored when used as an installer option is now documented in the installation procedures: "Because --hostname is considered an Atomic option in this case, not an Identity Management installer option, use it before the ipa-replica-install option. The installation ignores --hostname when used after ipa-replica-install."

> 
> Maybe would be nice to add ipa-server-install into examples and just say
> that this is default operation and may be ommited

A splendid idea! Done, for example: "atomic install rhel7/ipa-server publish --hostname fully_qualified_domain_name ipa-server-install"

I also added the syntax (comment#2) in the boxes for installation command examples. It shows that ipa-server-install is an optional component.

> 
> Also I found that examples with ipa-replica-install have wrong position of
> --hostname option

Fixed -- I checked all occurrences of --hostname, and it's always shown before ipa-server-install or ipa-replica-install.

Comment 8 Aneta Šteflová Petrová 2017-08-23 07:26:19 UTC
This update was published last week: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/using_containerized_identity_management_services/

All occurrences of --hostname should now be okay.


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