Giter VIP home page Giter VIP logo

Comments (6)

M0rfic avatar M0rfic commented on June 12, 2024 1

I ran some more tests and everything is fine even after rebooting. In conclusion using a named volume works as expected.

from ignition-docker.

thirdgen88 avatar thirdgen88 commented on June 12, 2024

Fixed with update to bring those configuration files directly into /var/lib/ignition/data

from ignition-docker.

M0rfic avatar M0rfic commented on June 12, 2024

Hi Kevin,

Quick question, how/when can one use the /var/lib/ignition (as specified on the docker hub page) volume bind to persist data? For example trying docker run --name ignition -v /opt/ignition:/var/lib/ignition -d kcollins/ignition (or even -v /opt/ignition:/var/lib/ignition/data) on a fresh machine, results in:

morfic@blackhole:~$ sudo docker logs ignition
FATAL  | wrapper  | Unable to open configuration file: /var/lib/ignition/data/ignition.conf (No such file or directory)
FATAL  | wrapper  |   Current working directory: /usr/local/share/ignition
FATAL  | wrapper  |   The Wrapper will stop.

Looking at the content of the exported image, it looks like the required files are inside one of the layer-tar files, thus something must be off somewhere but I can't put my finger on it

Layer content

Kind regards

from ignition-docker.

thirdgen88 avatar thirdgen88 commented on June 12, 2024

@M0rfic, I see the same behavior here.. I'm certain that this worked at some point so I'll need to see what happened.. Many of the times I use this image I'm using it in a docker-compose setup, e.g.:

version: '3'
services:
  gateway:
    image: "kcollins/ignition:latest"
    volumes:
      - gateway_data:/var/lib/ignition
    ports:
      - "8088:8088"
  db:
    image: "mysql:5.7"
    volumes:
      - db_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: ignition

volumes:
  gateway_data:
  db_data:

Just put the above into a docker-compose.yml inside of an empty directory, cd to it and run docker-compose up -d. You can then shutdown and remove the containers (preserving the volumes) with docker-compose down (you can wipe everything with docker-compose down -v).

I just tested this and it successfully preserves things as expected. I'll get back with you as to why the base bind-mounting isn't behaving properly.

from ignition-docker.

thirdgen88 avatar thirdgen88 commented on June 12, 2024

@M0rfic, in another look at the documentation I posted, I see now that I only suggest use of a named volume, not a bind-mount volume. I'll leave this issue open and see if I can come up with the suggested way to have the persisted data live directly in a specific location on the host (versus squirreled away in the Docker volume structures elsewhere on the filesystem).

Take a closer read at How to Persist Gateway Data and see if that makes sense.

from ignition-docker.

M0rfic avatar M0rfic commented on June 12, 2024

Kevin, thanks for taking the time to reply and for "investing" in the images themselves.

It seems that with a named volume it works as expected. I didn't want to use them in the first place because I was not entirely sure that they were persisted on reboots. I'm running them under rancher-os and I had some issues with binding the gwbk file because I put it in such a directory, and upon restart it vanished. However, given that this is a main feature of docker, I suppose that the configured directory for named volumes should be persisted. I'll make some more tests, as I can't restart the VM right now and get back to you.

P.S. Perhaps it would be a good idea to update the docs and specify specifically that named mounts are required, you know for those of us that are not native English speakers 😄.

from ignition-docker.

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.