Git Product home page Git Product logo

Comments (6)

lignumaqua avatar lignumaqua commented on June 26, 2024 1

Thanks! :-)

from kelvin.

stefanwichmann avatar stefanwichmann commented on June 26, 2024

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.

lignumaqua avatar lignumaqua commented on June 26, 2024

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.

stefanwichmann avatar stefanwichmann commented on June 26, 2024

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.

lignumaqua avatar lignumaqua commented on June 26, 2024

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.

stefanwichmann avatar stefanwichmann commented on June 26, 2024

Perfect! Glad it worked.

from kelvin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.