docker-volume

I am trying to use gcs bucket as the volume in gke pod

吃可爱长大的小学妹 提交于 2019-12-05 09:39:49
I am getting the error: error validating "mysql.yaml": error validating data: ValidationError(Deployment.spec.template.spec.volumes[0]): unknown field "path" in io.k8s.kubernetes.pkg.api.v1.Volume; ) apiVersion: extensions/v1beta1 kind: Deployment metadata: name: mysql labels: app: mysql spec: replicas: 1 selector: matchLabels: app: mysql template: metadata: labels: app: mysql spec: containers: - image: mysql:5.6 name: mysql env: - name: MYSQL_ROOT_PASSWORD valueFrom: secretKeyRef: name: mysql key: password ports: - containerPort: 3306 name: mysql volumeMounts: - name: mapping-sandbox-test

How to store a specific named docker volume at a specific location without changing the default?

拥有回忆 提交于 2019-12-05 08:19:24
I would like to create a named volume for one of my containers. This container will need a lot more storage than other containers I run, so I would like to store that particular volume on a different disk that has lots of free space. I still want the other volumes on the default disk, only that one named volume should go on another disk. I don't want to use a bind mount because it will make backing up and migrating more complicated. The only option I can think of is to manually move the volume after it is created (while the container is stopped), and create a symlink from its original location

docker run with --volume

…衆ロ難τιáo~ 提交于 2019-12-05 07:15:41
I'm trying to dockerize some services for development on my machine and wondering how docker run --volume=.. works. For example, if I do something like docker run --volume=/path/to/data:/data [...] will /path/to/data be (re)created locally only if it doesn't exist? Is the initial data copied from the container's image? Links to relevant documentation would be appreciated. The --volume option is described in the docker run reference docs , which forwards you on to the dedicated Managed data in containers docs, which then forwards you on to the Bind mounts docs. There, it says: If you use -v or

Mount a volume in docker-compose conditionally

烈酒焚心 提交于 2019-12-04 22:33:42
I have a docker-compose.yml configuration. One of the containers there is a Tomcat server and it has some default .war file deployed in webapps directory. I want to have the ability to pass (override) the war archive to be deployed by some which resides on the host machine. I think the best would be to have ability somehow switch / override starting docker-compose : as a default, I want to run the webapp ( war file) which is inside the container, but I want to have a possibility to mount a directory from my host (for example during development / debugging) if need be. Currently, I have the

Does docker run -v or Dockerfile VOLUME take precedence?

独自空忆成欢 提交于 2019-12-04 19:59:23
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:0.1 But then I tried supplying the volume at runtime as below: docker run -v /var/tmp kz/test-volume:0

Kubernetes (in Docker for Windows) Volume Configuration for Postgres

纵饮孤独 提交于 2019-12-04 17:48:39
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" #emptyDir: {} hostPath: path: /c/temp/vols/pgdata containers: - image: postgres name: db ports: -

Docker - Can't share data between containers within a volume (docker-compose 3)

泪湿孤枕 提交于 2019-12-04 10:51:55
问题 I have some containers for a web app for now (nginx, gunicorn, postgres and node to build static files from source and a React server side rendering). In a Dockerfile for the node container I have two steps: build and run (Dockerfile.node). It ends up with two directories inside a container: bundle_client - is a static for an nginx and bundle_server - it used in the node container itself to start an express server. Then I need to share a built static folder ( bundle_client ) with the nginx

Add bind mount to Dockerfile just like volume

我的未来我决定 提交于 2019-12-04 08:24:46
问题 I want to add the bind mount to docker file just like I initialise a volume inside Dockefile. Is there any way for it? 回答1: A Dockerfile defines how an image is built, not how it's used - so you can't specify the bind mount in a Dockerfile. Try using docker-compose instead. A simple docker-compose.yml that mounts a directory for you would look like this: version: '3.1' services: mycontainer: image: myimage build: . volumes: - './path/on/docker/host:/path/inside/container' The build: . is

How specify the size of a shared Docker volume?

末鹿安然 提交于 2019-12-04 07:02:37
If I would like to create a data volume of let´s say 15GB that would be of type ext4, how would I do that? docker volume create --name vol just creates an empty volume. docker volume create --opt type=ext4 --name vol creates an ext4 volume but I cannot specify the size of it since ext4 does not support it according to the mount options of ext4. It is possible to specify the size limit while creating the docker volume using size as per the documentation Here is example command provided in the documentation to specify the same docker volume create -d flocker -o size=20GB my-named-volume UPDATE

Create Docker volume with preexisting data in it

天大地大妈咪最大 提交于 2019-12-04 06:36:19
问题 I have a MySQL image that I launch a container from. I set up dbs , import sql-dump files and create users every time the container is created. When I work on the container I create various data that are stored in MySQL. I would like to save these extra data in a data volume container [DVC] so I could give the DVC to a colleague and continue from where I stopped. The thing is that he will also launch a MySQL container and the initial procedure will be repeated from scratch. As I have read, if