Closed raph521 closed 5 years ago
FWIW, I managed to get this sorted by installing the gcc and g++ packages. I created a custom Dockerfile for armhf that does just that:
https://github.com/Raph521/Kitana/blob/master/Dockerfile.armhf
# Use an official Python runtime as a parent image
FROM python:3.5-slim
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN apt-get update \
&& apt-get install -y apt-utils gcc g++ \
&& pip install --trusted-host pypi.python.org -r requirements.txt
# Make port 80 available to the world outside this container
EXPOSE 31337
# Define environment variable
#ENV NAME World
VOLUME /app/data
# Run app.py when the container launches
ENTRYPOINT ["python", "kitana.py"]
Interesting. Care to create a pull request so I can merge that Dockerfile?
Would be happy to... but it turns out that didn't get Kitana completely working for me on ARM.
I was able to build it and start the container, but when I visit the webpage on 31337, I'm greeted with the following:
500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/zc/lockfile/__init__.py", line 81, in __init__
fp = open(path, 'r+')
FileNotFoundError: [Errno 2] No such file or directory: '/app/data/sessions/session-80cb366212ddbd7d5dfe6910fb4e8264b2d88c53.lock'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 628, in respond
self._do_respond(path_info)
File "/usr/local/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 678, in _do_respond
self.hooks.run('before_request_body')
File "/usr/local/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 114, in run
raise exc
File "/usr/local/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 104, in run
hook()
File "/usr/local/lib/python3.5/site-packages/cherrypy/_cprequest.py", line 63, in __call__
return self.callback(**self.kwargs)
File "/usr/local/lib/python3.5/site-packages/cherrypy/_cptools.py", line 280, in _lock_session
cherrypy.serving.session.acquire_lock()
File "/usr/local/lib/python3.5/site-packages/cherrypy/lib/sessions.py", line 557, in acquire_lock
self.lock = zc.lockfile.LockFile(path)
File "/usr/local/lib/python3.5/site-packages/zc/lockfile/__init__.py", line 117, in __init__
super(LockFile, self).__init__(path)
File "/usr/local/lib/python3.5/site-packages/zc/lockfile/__init__.py", line 87, in __init__
fp = open(path, 'a+')
FileNotFoundError: [Errno 2] No such file or directory: '/app/data/sessions/session-80cb366212ddbd7d5dfe6910fb4e8264b2d88c53.lock'
I'm launching the container via docker-compose with the following:
kitana:
container_name: kitana
build:
context: https://github.com/Raph521/Kitana.git
dockerfile: Dockerfile.armhf
restart: unless-stopped
volumes:
- /media/storage/config/kitana:/app/data
environment:
- TZ=America/New_York
ports:
- 31337:31337
Hmm, that one again. Can you mkdir /app/data/sessions
?
Yeah, I eventually figured out that was the problem :-)
I tried to come up with a platform agnostic way to create the directory on startup if it already doesn't exist. Still need to test it - takes a bit of time to build the image on a Raspberry Pi...
https://github.com/Raph521/Kitana/commit/afe54c243d408baefbb4df5e4cb4841d1a498eb1
Haha, I just pushed a quick fix for that, the minute you wrote :D
Haha, okay then, thanks!
I'll create a pull request just for the Dockerfile.armhf!
Hmm your makedirs solution is better, though. I'll incorporate that.
Okay, pull request created:
Great, thank you!
Thanks for the help and for all your work on this project!
My pleasure :)
Hi,
I encountered an issue when attempting to build an image myself through docker compose. I'm building the image myself as my architecture is armhf.
During the build, I encounter the following error:
I believe that the issue is that the Dockerfile specifies a base image of python:3.5-slim, but gcc is not available in that image. I noticed this mentioned here:
https://github.com/docker-library/python/issues/60
Should gcc be added to the prereq's file, or maybe the base image changed?
Here's my docker-compose yaml, if it helps: