Comments (6)
Thanks! :-)
from kelvin.
Hi,
thanks for reporting this issue. I think should clarify some concepts of docker before we jump to conclusions. Having all files of a container isolated inside itself (by default) is one of the goals and big advantages of docker. So it is not (and should not be possible) to access host files from inside a container. If you need to persist application data over the lifetime of a container it is always the other way round: The host mounts files/folder inside the container at defined mount points without the container knowing about it. "Typical" paths like /config don't exist here because the host and/or container could be a windows system... For a general overview of the storage concepts of docker you could have a look at https://docs.docker.com/storage/.
The described behaviour of an updated Dockerfile overwriting existing configurations is not true either. Please have a look at https://docs.docker.com/get-started/#images-and-containers for the basic concepts of images and containers. Any change to the Dockerfile will create a new images. If you create new containers from this new image a new configuration will be created inside the new container. Any old container will remain unchanged without loosing it's configuration. In addition to this Kelvin will update itself inside running containers to benefit from recent improvements.
If you want to persist one configuration over the lifetime of different containers (and potentially different images) you could have a look at #32 to learn about current limitations of Kelvin and suggestions to work around them.
Hope this helps!?!
from kelvin.
Thanks for the rapid response! Allthough I’m in no way a Docker expert, I think I understand all that. However, just about every Docker I run uses a volume mapping to store its data, including its configuration files, on the host system so that the data persists and can be backed up. The problem here is that there is no path within the Kelvin docker that we can map to. The config file is stored in the Kelvin directory itself.
What I meant by /config is that it is common to store such files in a /config folder within the container and then allowing the user, through the -v run command, to map that folder to wherever they want. This is typically done using an ln hard link in the Dockerfile. We also can’t add those mappings in the container as you are distributing an image, not a Dockerfile.
What I’m requesting is that config.json is stored in a mappable folder rather than the root. I’d also perhaps request that the Docker be distributed as a Dockerfile as well as an image so that we build our own image for updates, but that’s not really necessary.
As I said, I’m not a Docker expert so I may already be able to do this with the current image, my apologies if that’s so. However I don’t want to spend time tweaking a config file only to have it disappear. Docker containers are designed to be ephemeral and not for storing editable data.
Not complaining by the way! To avoid this problem I’m currently running Kelvin in a Ubuntu VM, but I’d rather run it as a Docker.
from kelvin.
No need to apologize! I got your question wrong. Didn't mean to be offensive!
I just released Kelvin v1.1.6 which allows custom path for the configuration outside the current working directory. As mentioned in #32 this was a limitation until now.
Your should now be able to mount the /etc/opt/kelvin folder on your host system and keep your configuration over the lifetime of your container. Let me know if this works for you!
from kelvin.
That worked perfectly, thank you!
I added the mapping to a folder on my server (I run Unraid) and mapped port 8080 in the container to 8084. My Docker run command looks like this:
docker run -d --name='kelvin' --net='bridge' -e TZ="America/Chicago" -e HOST_OS="unRAID" -p '8084:8080/tcp' -v '/mnt/user/appdata/kelvin/':'/etc/opt/kelvin/':'rw' 'stefanwichmann/kelvin'
Worked first time and everything looks good. The config.json is now back in the server on a regular disk and gets backed up.
from kelvin.
Perfect! Glad it worked.
from kelvin.
Related Issues (20)
- After the Upgrade to v1.3.3, Kelvin No Longer Reacts to Lights Turning On HOT 4
- Push new releases to Docker Hub? HOT 1
- Possible to have defined time take precedence over sunset?
- Daylight Savings Adjustment
- Can't run on mac HOT 2
- How to make Kelvin play nicely with the "Wake up with light" automation? HOT 1
- How to stop Kelvin for disabling when physical lightswitch turned off and on? HOT 5
- How do I change the lights at exactly sunrise and sunset? HOT 1
- Kel
- Auto update to 1.3.5 failing on raspberry pi HOT 2
- Hue API v2 support
- Previous versions were deleted from Docker Hub HOT 1
- 1.3.5 unable to serve GUI HOT 2
- Disable automatic Updates HOT 1
- "enable kelvin" greyed out in dashboard
- Kelvin is turning on unassociated lights
- y
- Down for me or everyone? HOT 3
- Kelvin only applies defaultBrightness, defaultTemperature and schedules. Nothing else. HOT 3
- Auto update installed bad binary on Raspberry Pi HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kelvin.