docker build failed at create_user script

Bug #1851242 reported by sven oehme
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LOCI
New
Undecided
Unassigned

Bug Description

i followed the instructions on github on how to build the containers and the following command fails :

docker build https://opendev.org/openstack/loci.git \
    --build-arg FROM=loci-base:ubuntu
    --build-arg PROJECT=keystone \
    --tag loci-keystone:ubuntu

it fails with :

Setting up virtualenv (15.0.1+ds-3ubuntu1) ...
Setting up dh-python (2.20170125~cloud0) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Processing triggers for ca-certificates (20170717~16.04.2) ...
Updating certificates in /etc/ssl/certs...
148 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
+ [[ '' == \r\e\q\u\i\r\e\m\e\n\t\s ]]
++ dirname /opt/loci/scripts/install.sh
+ /opt/loci/scripts/fetch_wheels.sh
+ [[ no == \n\o ]]
+ python=python2
++ dirname /opt/loci/scripts/fetch_wheels.sh
+ python2 /opt/loci/scripts/fetch_wheels.py
http://auth.docker.io/token?service=registry.docker.io&scope=repository:loci/requirements:pull
http://registry.hub.docker.com/v2/loci/requirements/manifests/master-ubuntu
http://registry.hub.docker.com/v2/loci/requirements/blobs/sha256:7cb32b3be26a8dcf194c676f5324f357bf2cd36582c34870f7f09e87fb936d8b
+ mkdir -p /tmp/wheels/
+ tar xf /tmp/wheels.tar.gz '--exclude=.*' -C /tmp/wheels/
+ [[ '' == \i\n\f\r\a ]]
+ [[ no == \n\o ]]
++ dirname /opt/loci/scripts/install.sh
+ /opt/loci/scripts/create_user.sh
+ groupadd -g 42424
Usage: groupadd [options] GROUP

Options:
  -f, --force exit successfully if the group already exists,
                                and cancel -g if the GID is already used
  -g, --gid GID use GID for the new group
  -h, --help display this help message and exit
  -K, --key KEY=VALUE override /etc/login.defs defaults
  -o, --non-unique allow to create groups with duplicate
                                (non-unique) GID
  -p, --password PASSWORD use this encrypted password for the new group
  -r, --system create a system account
  -R, --root CHROOT_DIR directory to chroot into
      --extrausers Use the extra users database

The command '/bin/sh -c /opt/loci/scripts/install.sh' returned a non-zero code: 2
zsh: command not found: --build-arg

Revision history for this message
Jake Yip (waipengyip) wrote :

the right command should be

docker build https://opendev.org/openstack/loci.git \
    --build-arg FROM=loci-base:ubuntu \
    --build-arg PROJECT=keystone \
    --tag loci-keystone:ubuntu

(note the missing \ on the second line)

I've sent up a review, waiting for the core developers to merge it.

Revision history for this message
sven oehme (oehmes) wrote :

thanks for this i haven't seen the missing \ but that explains it.
there seems to be other bugs in the documentation

e.g. this. :

$ docker build https://opendev.org/openstack/loci.git#master:dockerfiles/ubuntu \
    --tag loci-base:ubuntu

should be :

$ docker build https://opendev.org/openstack/loci.git#master:dockerfiles/ubuntu_bionic \
    --tag loci-base:ubuntu

Revision history for this message
sven oehme (oehmes) wrote :

and as soon as you get past thee 2 documentation issues, it fails here :

Step 29/29 : RUN /opt/loci/scripts/install.sh
 ---> Running in 914d9fb7729b
++ awk -F= '/^ID=/ {gsub(/\"/, "", $2); print $2}' /etc/lsb-release /etc/os-release
+ distro=ubuntu
+ export distro=ubuntu
+ distro=ubuntu

.... lots of logs ...

+ pip install --upgrade virtualenv
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Looking in indexes: https://pypi.python.org/simple/
Collecting virtualenv
  Downloading virtualenv-20.0.4-py2.py3-none-any.whl (4.6 MB)
Collecting importlib-metadata<2,>=0.12; python_version < "3.8"
  Downloading importlib_metadata-1.5.0-py2.py3-none-any.whl (30 kB)
Collecting pathlib2<3,>=2.3.3; python_version < "3.4" and sys_platform != "win32"
  Downloading pathlib2-2.3.5-py2.py3-none-any.whl (18 kB)
Collecting importlib-resources<2,>=1.0; python_version < "3.7"
  Downloading importlib_resources-1.0.2-py2.py3-none-any.whl (32 kB)
Collecting filelock<4,>=3.0.0
  Downloading filelock-3.0.12.tar.gz (8.5 kB)
    ERROR: Command errored out with exit status 1:
     command: /var/lib/pipbootstrap/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tyMEEr/filelock/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tyMEEr/filelock/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-tyMEEr/filelock/pip-egg-info
         cwd: /tmp/pip-install-tyMEEr/filelock/
    Complete output (3 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named setuptools
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The command '/bin/sh -c /opt/loci/scripts/install.sh' returned a non-zero code: 1

Revision history for this message
sven oehme (oehmes) wrote :

seems like the we are missing python-setuptools or python3-setuptools

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.