687 shaares
3 liens privés
3 liens privés
7 résultats
taggé
docker
On my postgresql docker image :
initdb: error: could not access directory "/home/postgres/pgdata/data": Permission denied
I reused a previous image
volumes:
- pgsql_data:/data/pgsql
environment:
PGDATA: /data/pgsql
So actions :
- start image without setting PGDATA, then execute :
Then :
docker exec myimage id # to check the user (here 1000:1000)
docker exec myimage ls -l /data/ # to check the mount directory
docker volume inspect pgsql_data # give the path of the volume
// update the rights
chown 1000:1000 -R /home/docker/volumes/pgsql_data
- stop
docker compose up pgsql
- restore PGDATA parameter
- restart
docker compose up pgsql
Another docker command :
docker cp <containerId>:/file/path/within/container /host/path/target
But can not use joker characters like "*"
Petit tutoriel éclairé sur l'init d'une base mongo sous docker
Flatten a docker container :
docker export <CONTAINER ID> | docker import - some-image-name:latest
plus intéressant : http://blog.loof.fr/2016/05/docker-cleanup.html
docker tag d583c3ac45fd myname/server:latest
Installation d'un plugin dans un docker sans internet
bin/plugin -u file:///your/zip/file/path -i mobz/elasticsearch-head
sudo docker exec -i -t loving_heisenberg bash
Docker behind proxy :
$ mkdir /etc/systemd/system/docker.service.d/
$ cat >/etc/systemd/system/docker.service.d/proxy.conf << EOF
[Service]
Environment=HTTP_PROXY=http://myproxy:3128/
EOF
$ systemctl daemon-reload
$ systemctl restart docker.service