E
E
Evgeny Ivanov2022-02-21 09:24:15
Docker
Evgeny Ivanov, 2022-02-21 09:24:15

How to create a file in a docker container?

Download grafana grafana/grafana.
I can't create my own file there (as an experiment).

I write in cmd

docker run -d -p 3000:3000 --name graf grafana/grafana
docker exec -it graf /bin/bash
echo "My file content" > my_file
bash: my_file Permission denied
id
uid=472(grafana) gid=0(root) groups=0(root)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2022-02-21
@2ord

https://docs.docker.com/storage/bind-mounts/

V
Vadim, 2022-02-21
@Viji

docker run -u 0 -d -p 3000:3000 --name graf grafana/grafana
docker exec -it -u 0 graf /bin/bash
echo "My file content" > my_file
cat my_file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question