Docker volume mount point

Hi all,

We host some docker containers that we let customers play with to test our product. For the longest time we've had issues whenever we take a container down and bring it up again because we had the ignition volume mapped to:

volumes:
- ignition-data:/usr/local/bin/ignition/data

We had issues because we stored stuff in user-lib which is in the directory above data. So whenever we did a "docker compose down" we'd lose a bunch of stuff.

I just did a quick test of mounting our volume at:

volumes:
- ignition-data:/usr/local/bin/ignition

and all seems to work. I can take them down and bring them up and everything seems cool. Now, this goes against the general recommendations that I've read about on these forums so I'm just wondering about the implications of me changing the mount point as described above. Can anyone point out any flaws in my cunning plan?

Not sure, but have you considered just making another volume and mount point for user-lib ?

That did cross my mind, and that may well be a more elegant and safer solution. I'll give it a whirl

1 Like

Refrain from doing either of these, as you'll end up persisting built-in modules (under user-lib/modules) and cause yourself troubles when you want to upgrade your Docker image (and you launch the newer base platform against [persisted] older modules).

@Darren_Steele, what kind of data are you storing there? If you're loading custom pylib content, take a look at the post here.

3 Likes

Ha, I'm glad you saw this and responded.

I had started responding to this yesterday to warn it would be trouble for upgrades, got distracted by something, and forgot about it entirely

2 Likes