Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker with SQLite fails to start due to incorrect parms #122

Open
ARGO1960 opened this issue Jan 8, 2021 · 3 comments
Open

Docker with SQLite fails to start due to incorrect parms #122

ARGO1960 opened this issue Jan 8, 2021 · 3 comments

Comments

@ARGO1960
Copy link

ARGO1960 commented Jan 8, 2021

Great work!.
Really like it helps me in small Lab without internet connections.
Now I was wondering what the SQLite version had to offer.
So I tried to run the python3 tag of the container.
But it complains about the -s parameter witch you can not set from the docker ENV..

I changed the start.sh where the -s param is handled.
FROM
/bin/bash -c "/usr/bin/python3 pykms_Server.py ${IP} ${PORT} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -s -w ${HWID} -V ${LOGLEVEL}

/bin/bash -c "/usr/bin/python3 pykms_Server.py ${IP} ${PORT} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -s ${PWD}/pykms_database.db -w ${HWID} -V ${LOGLEVEL}

now it works.

@simonmicro
Copy link
Contributor

@SystemRage Did this change, or did I just messed that one up?

@ARGO1960
Copy link
Author

Well I liked the SQLITE stuff just to see whats activated.
then I found the db is lost every time I rebuild the container, witch is default behavior..

So I did some changes for my self but maybe an idea to put in for the python3 TAG.
First I changed again the start.sh where the -s parameter is set. Like this: (Only show one line)
if [ "$LOGSIZE" == "" ];
then
/bin/bash -c "/usr/bin/python3 pykms_Server.py ${IP} ${PORT} -l ${LCID} -c ${CLIENT_COUNT} -a ${ACTIVATION_INTERVAL} -r ${RENEWAL_INTERVAL} -s ${SQLITEDIR}/pykms_database.db -w ${HWID} -V ${LOGLEVEL} -F ${LOG$
sleep 5
/usr/bin/python3 pykms_Client.py ${IP} ${PORT} -m Windows10 &
/usr/bin/python3 /home/sqlite_web/sqlite_web.py -H ${IP} -x ${SQLITEDIR}/pykms_database.db --read-only

THEN in the Dockerfile add
ENV SQLITEDIR /home/py-kms/db

This way you can override the directory you would like to have the DB.
NOW in the docker-compose.yaml
environment:
- SQLITEDIR=/home/py-kms/db/
volumes:
- ./:/home/py-kms/db:rw

regards
Arnold

@simonmicro
Copy link
Contributor

Yes and no - I think I would modify the path to point to a more "well known" data path like /data, which could be easily mounted into volumes. The same for the log files, I think we should move them to /log, so you could more easily access them, without having to know the container structure... Also note that into the docs! Maybe we should even start to clean everything up? Like move the pykms files into /srv?

Has anyone some thoughts on this? 🤔

SystemRage added a commit that referenced this issue Jan 24, 2021
Merged fix of #122 (explicitly set the default variable for the db path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants