Docker Community Forums

Share and learn in the Docker community.

Novice in need of help

docker

(Rupereztx) #1

I am just learning this cool tech, I am trying to build my first container (following the tutorial) but I keep getting the following error when I try to do the app itself. Any ideas what I am doing wrong or missed?

pip install -r requirements.txt
Collecting Flask (from -r requirements.txt (line 1))
Using cached Flask-0.12.2-py2.py3-none-any.whl
Collecting Redis (from -r requirements.txt (line 2))
Using cached redis-2.10.6-py2.py3-none-any.whl
Collecting Jinja2>=2.4 (from Flask->-r requirements.txt (line 1))
Using cached Jinja2-2.10-py2.py3-none-any.whl
Collecting Werkzeug>=0.7 (from Flask->-r requirements.txt (line 1))
Using cached Werkzeug-0.14.1-py2.py3-none-any.whl
Collecting click>=2.0 (from Flask->-r requirements.txt (line 1))
Using cached click-6.7-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from Flask->-r requirements.txt (line 1))
Using cached itsdangerous-0.24.tar.gz
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->Flask->-r requirements.txt (line 1))
Using cached MarkupSafe-1.0.tar.gz
Installing collected packages: MarkupSafe, Jinja2, Werkzeug, click, itsdangerous, Flask, Redis
Running setup.py install for MarkupSafe … error
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize;file=’/private/var/folders/f_/774yzv1j1dd13877c12l0tlh0000gn/T/pip-build-U0gthP/MarkupSafe/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /var/folders/f_/774yzv1j1dd13877c12l0tlh0000gn/T/pip-0dxJNF-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.13-intel-2.7
creating build/lib.macosx-10.13-intel-2.7/markupsafe
copying markupsafe/_constants.py -> build/lib.macosx-10.13-intel-2.7/markupsafe
copying markupsafe/init.py -> build/lib.macosx-10.13-intel-2.7/markupsafe
copying markupsafe/_native.py -> build/lib.macosx-10.13-intel-2.7/markupsafe
copying markupsafe/_compat.py -> build/lib.macosx-10.13-intel-2.7/markupsafe
running egg_info
writing MarkupSafe.egg-info/PKG-INFO
writing top-level names to MarkupSafe.egg-info/top_level.txt
writing dependency_links to MarkupSafe.egg-info/dependency_links.txt
warning: manifest_maker: standard file ‘-c’ not found

reading manifest file 'MarkupSafe.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MarkupSafe.egg-info/SOURCES.txt'
copying markupsafe/_speedups.c -> build/lib.macosx-10.13-intel-2.7/markupsafe
running build_ext
building 'markupsafe._speedups' extension
creating build/temp.macosx-10.13-intel-2.7
creating build/temp.macosx-10.13-intel-2.7/markupsafe
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c markupsafe/_speedups.c -o build/temp.macosx-10.13-intel-2.7/markupsafe/_speedups.o
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.13-intel-2.7/markupsafe/_speedups.o -o build/lib.macosx-10.13-intel-2.7/markupsafe/_speedups.so
running install_lib
creating /Library/Python/2.7/site-packages/markupsafe
error: could not create '/Library/Python/2.7/site-packages/markupsafe': Permission denied

----------------------------------------

Command “/usr/bin/python -u -c “import setuptools, tokenize;file=’/private/var/folders/f_/774yzv1j1dd13877c12l0tlh0000gn/T/pip-build-U0gthP/MarkupSafe/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /var/folders/f_/774yzv1j1dd13877c12l0tlh0000gn/T/pip-0dxJNF-record/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /private/var/folders/f_/774yzv1j1dd13877c12l0tlh0000gn/T/pip-build-U0gthP/MarkupSafe/


(Sam) #2

could u post the dockerflle, and the link to the tutorial…


(Rupereztx) #3

dockerfile:

CloudApp

link to tutorial;


(Sam) #4

hm… i cut.pasted those files from the tutorial and it worked

sam@buildserver:~/test$ docker build -t foop .
Sending build context to Docker daemon  5.632kB
Step 1/7 : FROM python:2.7-slim
 ---> 4fd30fc83117
Step 2/7 : WORKDIR /app
Removing intermediate container 47b52fcec0c3
 ---> b86b7f43d5e2
Step 3/7 : ADD . /app
 ---> 1dda6be85859
Step 4/7 : RUN pip install --trusted-host pypi.python.org -r requirements.txt
 ---> Running in 65a67d1a938d
Collecting Flask (from -r requirements.txt (line 1))
  Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
Collecting Redis (from -r requirements.txt (line 2))
  Downloading redis-2.10.6-py2.py3-none-any.whl (64kB)
Collecting itsdangerous>=0.21 (from Flask->-r requirements.txt (line 1))
  Downloading itsdangerous-0.24.tar.gz (46kB)
Collecting Jinja2>=2.4 (from Flask->-r requirements.txt (line 1))
  Downloading Jinja2-2.10-py2.py3-none-any.whl (126kB)
Collecting Werkzeug>=0.7 (from Flask->-r requirements.txt (line 1))
  Downloading Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
Collecting click>=2.0 (from Flask->-r requirements.txt (line 1))
  Downloading click-6.7-py2.py3-none-any.whl (71kB)
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->Flask->-r requirements.txt (line 1))
  Downloading MarkupSafe-1.0.tar.gz
Building wheels for collected packages: itsdangerous, MarkupSafe
  Running setup.py bdist_wheel for itsdangerous: started
  Running setup.py bdist_wheel for itsdangerous: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/fc/a8/66/24d655233c757e178d45dea2de22a04c6d92766abfb741129a
  Running setup.py bdist_wheel for MarkupSafe: started
  Running setup.py bdist_wheel for MarkupSafe: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/88/a7/30/e39a54a87bcbe25308fa3ca64e8ddc75d9b3e5afa21ee32d57
Successfully built itsdangerous MarkupSafe
Installing collected packages: itsdangerous, MarkupSafe, Jinja2, Werkzeug, click, Flask, Redis
Successfully installed Flask-0.12.2 Jinja2-2.10 MarkupSafe-1.0 Redis-2.10.6 Werkzeug-0.14.1 click-6.7 itsdangerous-0.24
Removing intermediate container 65a67d1a938d
 ---> 4f6489919cee
Step 5/7 : EXPOSE 80
 ---> Running in 024bf0860039
Removing intermediate container 024bf0860039
 ---> 939f38189d4f
Step 6/7 : ENV NAME World
 ---> Running in 8c7f3f978ad3
Removing intermediate container 8c7f3f978ad3
 ---> 7c9e48005ee8
Step 7/7 : CMD ["python", "app.py"]
 ---> Running in 0e9efda51abc
Removing intermediate container 0e9efda51abc
 ---> bda778be547f
Successfully built bda778be547f
Successfully tagged foop:latest

and executed without problem on both linux (ubuntu 14.04) and on my mac (high sierra)

I do not have proxies tho