inveniosoftware / inveniosoftware/cookiecutter-invenio-instance

docker-images.sh fails

Open
#244 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6
Forks
38
PR merge metrics
No merged PRs in 30d

Description

Package version (if known): latest, 3.3

## Describe the bug
The script [./docker/build-images.sh](https://github.com/inveniosoftware/cookiecutter-invenio-instance/blob/master/%7B%7Bcookiecutter.project_shortname%7D%7D/docker/build-images.sh) fails. The [Dockerfile.base](https://github.com/inveniosoftware/cookiecutter-invenio-instance/blob/master/%7B%7Bcookiecutter.project_shortname%7D%7D/Dockerfile.base) does not copy the project and the `setup.py` file, needed by the `pipenv` command.

## Steps to Reproduce
1. cookiecutter a new instance
2. run `./docker/build-images.sh`
3. See error

## Expected behavior
It should build the images :)

## Stacktrace

```
./docker/build-images.sh
Sending build context to Docker daemon 1.354MB
Step 1/3 : FROM inveniosoftware/centos7-python:3.6
---> d207351414dd
Step 2/3 : COPY Pipfile Pipfile.lock ./
---> Using cache
---> 40067563a31a
Step 3/3 : RUN pipenv install --deploy --system
---> Running in fa547f7baab1
Installing dependencies from Pipfile.lock (a2ed81)…
Ignoring appnope: markers 'sys_platform == "darwin"' don't match your environment
An error occurred while installing -e .! Will try again.
Installing initially failed dependencies…
[pipenv.exceptions.InstallError]: File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pipenv/core.py", line 1874, in do_install
[pipenv.exceptions.InstallError]: keep_outdated=keep_outdated
[pipenv.exceptions.InstallError]: File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]: pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]: File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pipenv/core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]: retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]: File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pipenv/core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]: _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]: File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]: raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: []
[pipenv.exceptions.InstallError]: ['ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: /opt/invenio/src']
ERROR: ERROR: Package installation failed...
The command '/bin/bash -c pipenv install --deploy --system' returned a non-zero code: 1
Sending build context to Docker daemon 1.355MB
Step 1/6 : ARG DEPENDENCIES_VERSION=latest
Step 2/6 : FROM fare-base:${DEPENDENCIES_VERSION}
pull access denied for fare-base, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
```

## Fix

Add:
```diff
FROM inveniosoftware/centos7-python:3.6
+ COPY ./ .
COPY Pipfile Pipfile.lock ./
RUN pipenv install --deploy --system
```

Reported by @CorsoGabriele and @EugenioCorso

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with {{cookiecutter.project_shortname}}/docker/build-images.sh and {{cookiecutter.project_shortname}}/Dockerfile.base, then reproduce the failure by running ./docker/build-images.sh on a new cookiecutter instance. Verify that the base image build can install the project and that the image build completes without the setup.py error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python, shell
Domain
build-system, devops
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.