docker-volume

Kubernetes - “Mount Volume Failed” when trying to deploy

末鹿安然 提交于 2021-02-19 07:49:51
问题 I deployed my first container, I got info: deployment.apps/frontarena-ads-deployment created but then I saw my container creation is stuck in Waiting status. Then I saw the logs using kubectl describe pod frontarena-ads-deployment-5b475667dd-gzmlp and saw MountVolume error which I cannot figure out why it is thrown: Warning FailedMount 9m24s kubelet MountVolume.SetUp failed for volume "ads-filesharevolume" : mount failed: exit status 32 Mounting command: systemd-run Mounting arguments: -

Why do some Docker images have no VOLUME defined?

醉酒当歌 提交于 2021-02-18 18:23:11
问题 I am just starting with Docker, please pardon me if my question is too silly for you. I see some images, like nginx , does not have any VOLUME defined whereas some images like mysql has VOLUME defined in their Dockerfile. How the data or files are managed when there is no volume defined, and what would be their working directory? 回答1: A preferred pattern for many applications you can run in a container is to store no state at all locally. If I have a Web application, and perhaps it takes a

Understanding docker -v command

爱⌒轻易说出口 提交于 2021-02-17 12:41:06
问题 I was just going through this tutorial on Youtube, trying to understand the use of the -v command. Why is the author using the -v command? He uses the command, like so: docker run -v /var/lib/mysql --name=my_datastore -d busybox echo "my datastore" Now I understand the above command to an extent: --name=my_datastore gives the container a specific name. -d busybox starts a container in detached mode, based on the busybox image. After the command is executed the below line is echoed to the

are VOLUME in Dockerfile persistent in kubernetes

那年仲夏 提交于 2021-02-17 06:01:18
问题 Some Dockerfile have a VOLUME command. What happens when such containers are deployed in Kubernetes, but no kubernetes volume are provided: no persistent volume (PV), nor persistent volume claim (PVC) ? Where are the file stored ? Is the volume persistent ? For exemple, Dockerfile image for Docker's library/postgreSQL container image has: VOLUME /var/lib/postgresql/data The stable/postgresql helm charts won't always create a PV: kind: StatefulSet ### SNIP SNIP ### containers: - name: {{

Docker - is it safe to switch to non-root user in ENTRYPOINT?

纵饮孤独 提交于 2021-02-08 09:20:11
问题 Is it considered a secure practice to run root privileged ENTRYPOINT ["/bin/sh", entrypoint.sh"] , that later switches to non-root user before running the application? More context: There are a number of articles (1, 2, 3) suggesting that running the container as non-root user is a best practice in terms of security. This can be achieved using the USER appuser command, however there are cases (4, 5) when running the container as root and only switching to non-root in the an entrypoint.sh

Docker: Strange behaviour of bind mount

99封情书 提交于 2021-02-08 07:42:35
问题 I have a compose file: version: "3" services: db: image: postgres:12.5 ports: - "15432:5432" restart: always environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: test volumes: - ./postgres-data:/var/lib/postgresql/data backend: image: backend depends_on: - db restart: always ports: - "6969:8000" volumes: - ./app:/app When I run docker-compose up to start the 2 containers, I notice that: Docker auto creates the directory postgres-data, and it transfers the content of

Docker: Permission denied when PHP upload file to mounted data volume

主宰稳场 提交于 2021-02-08 04:30:11
问题 I'm using docker quickstart terminal on Win10 . Client: Version: 17.06.0-ce, API version: 1.30 Go version: go1.8.3 Git commit: 02c1d87 Built: Fri Jun 23 21:30:30 2017 OS/Arch: windows/amd64 I have a simple document upload php script that saves an uploaded document to a file location called '/uploads'. I want to make the '/uploads' folder a volume attached to the php:apache container, so i can easily share the contents with the python back-end. I'm using the following docker-compose.yml file

Difference in accessing windows path in volume creation in windows Docker

一曲冷凌霜 提交于 2021-01-29 19:02:58
问题 I have two drives, the local drive (C:) When a volume is mounted using this path it works perfectly fine. ex: docker run --rm -it -v "C:/data":/aug aif . I have an external NAS drive, I map it, and name it as (Z:) I use the command ex: docker run --rm -it -v "Z:/data":/aug aif . Which gives an error that the files are not present in the /aug directory within the container. I am loading data into my software to train deep learning models. So, in case of 1. , the system works fine and the data

'docker run' using mount volume option '-v' with single directory as parameter (no source and destination split with colon mark (“:”))

可紊 提交于 2021-01-29 07:17:57
问题 On this page https://mherman.org/blog/dockerizing-an-angular-app/ , At some point in this tutorial there is this command to launch the container: $ docker run -v ${PWD}:/app -v /app/node_modules -p 4201:4200 --rm example:dev . I don't understand the -v /app/node_modules part. What is the purpose of -v when there are no source and destination split by a colon mark? I've been reading official documentation: https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only ;

Docker NFS volume using Ansible

旧时模样 提交于 2021-01-28 05:48:33
问题 Given a simple example such as $ docker volume create --driver local \ --opt type=nfs \ --opt o=addr=192.168.1.1,rw \ --opt device=:/path/to/dir \ foo How can I do the same using Ansible? I tried for example - name: NFS volume mount docker_volume: driver: "local" driver_options: type: nfs o: "addr=192.168.1.1,rw" device: /path/to/dir volume_name: foo Which will create the volume without errors but it will fail when the volume is used with docker_container module. TASK [oracle-database :