Skip to content

Dockerfile option Volume - where is it mounted with k3s? #5770

Answered by ChristianCiach
sando38 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, the volumes are still mounted, but (as you expected) somewhere else.

K3s bundles containerd as the container runtime instead of docker. You can use the command k3s ctr as a CLI for containerd.

As an example, let's take a look at the official redis image which declares a volume in its Dockerfile:

VOLUME [/data]

Let's use k3s ctr container list (which is roughly equivalent to docker ps) to find the container-id. Keep in mind that you have to run this command on the node where the container is actually running. For me it looks like this:

e029be12bf574fb3c8ae226a50e5428a0f68cebfe8c18da9af9a840d7706bf99    docker.io/library/redis@sha256:21db12e5ab3cc343e9376d655e8eabbdbe5516801373e95a8a9…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brandond
Comment options

Answer selected by sando38
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants