docker-volume

Docker volume - need permissions to write to database

时间秒杀一切 提交于 2019-12-23 11:40:15
问题 I'm working on a flask server (in a virtualenv with python 3.5) which is used as a REST API (only for development as suggested for flask). In the beginning it connects to a local sqlite database and it will commit any db changes as soon as possible. Now I wanted to run everything in a docker container and I was wondering how I can access the database because the sqlite file is located in the container. So I created a volume in a docker-compose file which points to the dockerfile building the

How to remove configure volumes in docker images

不打扰是莪最后的温柔 提交于 2019-12-20 02:41:32
问题 I use docker run -it -v /xx1 -v /xx2 [image] /bin/bash to create a container. Then commit to image and push to docker hub. use docker inspect [image] The Volumes detail is "Volumes": { "/xx1": {}, "/xx2": {} }, Now I want to remove volume /xx1 in this image. What should I do? 回答1: I don't think this is possible with the Docker tools right now. You can't remove a volume from a running container, or if you were to use your image as the base in a new Dockerfile you can't remove the inherited

Create docker volume with limited size

孤街浪徒 提交于 2019-12-18 03:42:40
问题 There is is very limited information regarding create volume with options "https://docs.docker.com/engine/reference/commandline/volume_create/ ". I just want to create a volume with limited size, I tried, docker volume create --opt o=size=10m hello-volume , when run a simple hello world container with “docker run -v hello-volume:/hello -it ubuntu /bin/bash”, I got the error as something like “docker: Error response from daemon: …no such device”… So I assumed we must give the full options when

Riak container does not start when its data volume is mounted

拈花ヽ惹草 提交于 2019-12-13 20:27:07
问题 The following command works perfectly and the riak service starts as expected: docker run --name=riak -d -p 8087:8087 -p 8098:8098 -v $(pwd)/schemas:/etc/riak/schema basho/riak-ts The local schemas directory is mounted successfully and the sql file in it is read by riak. However if I try to mount the riak's data or log directories, the riak service does not start and timeouts after 15 seconds: docker run --name=riak -d -p 8087:8087 -p 8098:8098 -v $(pwd)/logs:/var/log/riak -v $(pwd)/schemas:

Docker volume mount doesn't exist

不羁岁月 提交于 2019-12-13 14:01:59
问题 I'm running Docker 1.11 on OS X and I'm trying to figure out where my local volumes are being written. I created a Docker volume by running docker volume create --name mysql . I then ran docker volume inspect mysql and it output the following: [ { "Name": "mysql", "Driver": "local", "Mountpoint": "/mnt/sda1/var/lib/docker/volumes/mysql/_data", "Labels": {} } ] The issue is /mnt/sda1/var/lib/docker/volumes/mysql/_data doesn't actually exist on my machine. I thought maybe the issue was that it

Does docker run -v or Dockerfile VOLUME take precedence?

北战南征 提交于 2019-12-13 12:19:49
问题 Dockerfile FROM nginx:1.7 # Deliberately declaring VOLUME before RUN VOLUME /var/tmp RUN touch /var/tmp/test.txt Observation Now I believe I understand the implications of declaring the VOLUME statement before creating test.txt - the volume /var/tmp exposed at runtime will be based on the intermediary container prior to the test.txt file is created so it will be empty (hope this observation is correct) So as expected the following docker run does not show test.txt : docker run kz/test-volume

How to share file or directory with other container on ECS?

淺唱寂寞╮ 提交于 2019-12-12 19:00:42
问题 I have a Sumologic log collector which is a generic log collector. I want the log collector to see logs and a config file from a different container. How do I accomplish this? 回答1: ECS containers can mount volumes so you would define { "containerDefinitions": [ { "mountPoints": [ { "sourceVolume": "logs", "containerPath": "/tmp/clogs/" }, } ], "volumes": [ { "name": "logs", } ] } ECS also has a nice UI you can click around to set up the volumes at the task definition level, and then the

Docker volume and host permissions

旧时模样 提交于 2019-12-12 17:26:34
问题 When I run a docker image for example like docker run -v /home/n1/workspace:/root/workspace -it rust:latest bash and I create a directory in the container like mkdir /root/workspace/test It's owned by root on my host machine. Which leads to I have to change the permissions everytime after I turn of the container to be able to operate with that directory. Is there a way how to tell Docker to handle directories and files from my machine (host machine) point of view under a certain user? 回答1:

How best to have files on volumes in Kubernetes using helm charts?

人盡茶涼 提交于 2019-12-12 12:40:08
问题 The plan is to move my dockerized application to Kubernetes. The docker container uses couple of files - which I used to mount on the docker volumes by specifying in the docker-compose file: volumes: - ./license.dat:/etc/sys0/license.dat - ./config.json:/etc/sys0/config.json The config file would be different for different environments, and the license file would be the same across. How do I define this in a helm template file (yaml) so that it is available for the running application? What

Kubernetes (in Docker for Windows) Volume Configuration for Postgres

混江龙づ霸主 提交于 2019-12-12 09:10:02
问题 I have a tomcat + postgres application that I test with docker-compose. I am trying to package the application in a kubernetes config file. For now, I am running kubernetes (and kubectl) using my Docker Desktop for Windows installation. Eventually, I want to deploy to other environments. I am currently trying to replicate some of the volume functionality in docker-compose within the following config file. apiVersion: v1 kind: Pod metadata: name: pg-pod spec: volumes: - name: "pgdata-vol"