volume

How do I mount a Docker volume while using a Windows host?

ε祈祈猫儿з 提交于 2019-11-26 20:28:27
问题 Mounting a Docker volume while being under a Windows host, has been a huge pain for me, and I could not get it to work. Currently I got the following simple Dockerfile: FROM php:5-apache RUN apt-get update When I build an image from it, and start a container docker build -t phisch:dev . docker run phisch:dev the container starts properly. But when I am trying to mount a volume, docker run -v /c/Users/phisch/dev/htdocs:/var/www phisch:dev the following message will be displayed: C:\Users

Android mute/unmute phone

本秂侑毒 提交于 2019-11-26 19:52:10
问题 My goal is to support 2 operations: mute phone (possibly with vibrations enabled/disabled), so when a call or sms is received it won't make noise unmute phone and restore the volume to the state before muting phone How can I do this? What permissions are required in AndroidManifest? 回答1: This is the permission for vibrate into the manifest file <uses-permission android:name="android.permission.VIBRATE" /> this is for to put the device in silent mode with vibrate AudioManager audioManager =

08-Docker容器数据持久化和数据共享

巧了我就是萌 提交于 2019-11-26 19:50:04
Docker容器数据持久化和数据共享 1. 概述 2. storage driver 3.volume driver 3.1 bind mount方式 3.2 volume方式 3.3 bind mount和volume对比 1. 概述 docker 主要有两种数据存储形式, 一种是storage driver(也叫做 Graph driver), 另一种是 volume driver。 stroage driver主要是存储那些无状态的数据,写入密集型的场景应该使用 volume driver。 2. storage driver 容器运行的文件系统是镜像层和容器层组成的,一层一层叠加,只有最上面的那层是可写的,其他层都是只读的。 Docker通过Union FS技术支持文件的读写和新建,Docker 采用插件式的方式支持多种Union FS实现,官方文档中一般使用stroage driver术语,目前已经有多种实现的插件, 比如: aufs、overlay、overlay2、devicemanger等等。 boot2docker 缺省使用的storage-driver 为 aufs,下面命令将创建一个使用 overlay2 的 storage driver docker运行环境。 docker-machine create --driver virtualbox -

Docker的持久化存储和数据共享

拥有回忆 提交于 2019-11-26 19:47:31
volume存储 查看volume列表 sudo docker volume ls 查看详情 sudo docker volume inspect 6ce358b6561136550039f9ec640b1aa0c89dfd05e5ea1c2ec4e2f8a7e37ca011 删除volume sudo docker volume rm 6ce358b6561136550039f9ec640b1aa0c89dfd05e5ea1c2ec4e2f8a7e37ca011 创建服务并指定volume名称和路径 -v mysql:/var/lib/mysql sudo docker run -v mysql:/var/lib/mysql -d --name mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=true mys ql 这种模式下,数据会保存到指定位置,即时删除了容器,数据也会保留,下次创建指定此路径的话,数据会恢复 Bind Mouting sudo docker run -v $(pwd):/skeleton -d --name flask fanxl12/flask-skeleton 把本地的skeleton映射到容器的skeleton目录,这个时候两边目录的文件会保持同步 来源: CSDN 作者: fanxl12 链接: https://blog

Docker 持久化存储和数据共享

泪湿孤枕 提交于 2019-11-26 19:47:01
Docker 的持久化存储和数据共享 一、Docker持久化数据的方案: 基于本地文件系统的Volume。 可以再执行Docker create 或 Docker run 时,通过-v 参数将主机的目录作为容器的数据卷。这部分功能便是基于本地文件系统的volume管理。 基于plugin的volume。 支持第三方的存储方案,比如NAS,aws。 Volume的类型: 受管理的data Volume,由docker后台自动创建。 绑定挂载的Volume,具体挂载位置可以由用户指定。 二、数据持久化(Data Volume): 基本使用语法: Dockerfile 文件: VOLUME ["/var/lib/mysql"] docker run -v mysql:/var/lib/mysql 查看容器日志: docker logs Containers[name] 创建一个Mysql容器并指定环境变量 -e docker run -d --name mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql 查看volume: docker volume ls [ root@localhost ~ ] # docker volume ls DRIVER VOLUME NAME local

Docker持久化存储与数据共享

非 Y 不嫁゛ 提交于 2019-11-26 19:46:11
一.Docker持久化数据的方案 基于本地文件系统的Volume:可以在执行docker create或docker run时,通过-v参数将主机的目录作为容器的数据卷。这部分功能便是基于本地文件系统的volume管理。 基于plugin的Volume:支持第三方的存储方案,比如NAS,aws 1.Volume的类型 受管理的data Volume,由docker后台自动创建 绑定挂载的Volume,具体挂载位置可以由用户指定 二.数据持久化:Data Volume 1.操作流程 注意:mysql的Dockerfile中由 VOLUME ["/var/lib/mysql"] 指定了持久化的路径,此路径是要被持久化的路径,默认volume的名称为local 执行 sudo docker run -d -v mysql:/var/lib/mysql --name mysql1 -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql 启用一个mysql的image容器,其中 -v 后跟的mysql表示volume别名,冒号后面的路径为volume本地存储的地址 查看 sudo docker volume ls 查看docker的volume,会发现自动生成了一个volume 通过 sudo docker volume inspect volume的NAME值

『中级篇』docker的数据持久化存储和数据共享(32)

心已入冬 提交于 2019-11-26 19:44:44
原创文章,欢迎转载。转载请注明:转载自 IT人故事会 ,谢谢! 原文链接地址: 『中级篇』docker的数据持久化存储和数据共享(32) 从这次开始docker的数据持久化存储和数据共享。 回忆下image 和 container的区别 image 不能写入数据,container可以写数据 container可以写入数据,执行操作,但是数据只限本个container。 场景问题 误删除container 如果我创建一个mysql的container,这个mysql运行了一年了,里面有很多的数据,在误操作的情况container ,结果一年的数据也就没有了,这是无法接受的。数据为王的年代,数据丢失了很恐怖的。 docker引入了持久化的机制Data Volume 图中的程序往两个地方,1. 往对应的layer存储,2.通过外挂载存储的方式 docker持久化数据的方案 基于本地文件系统的Volume。可以在执行Docker create 或Docker run时,通过-v参数将主机的目录作为容器的数据卷,基本都是用这种方式。 基于plugin的Volume,支持第三方的存储方案,比如NAS,aws Volume的类型 收管理的data Volume,由docker后台自动创建,位置是固定,名字是随机的 绑定挂载的Volume,具体挂载位置可以由用户指定。 PS:源码 https:/

What is the purpose of VOLUME in Dockerfile

浪尽此生 提交于 2019-11-26 19:13:35
问题 I'm trying to go deeper in my understanding of Docker's volume, and I'm having an hard time to figure out the differences / use-case of: The docker volume create command The docker run -v /path:/host_path The VOLUME entry in the Dockerfile file I particularly don't understand what happens if you combine the VOLUME entry with the -v flag. 回答1: A volume is a persistent data stored in /var/lib/docker/volumes/... You can either declare it in a Dockerfile, which means each time a container is

Get System Volume iOS

六眼飞鱼酱① 提交于 2019-11-26 18:48:25
My case is simple: I need to play a warning signal and want to make sure the user will hear it, so I want to check the system volume. How can I find out what the current system volume is? The audio session can provide output volume (iOS >= 6.0). float vol = [[AVAudioSession sharedInstance] outputVolume]; NSLog(@"output volume: %1.2f dB", 20.f*log10f(vol+FLT_MIN)); Try this: MPMusicPlayerController *iPod = [MPMusicPlayerController iPodMusicPlayer]; float volumeLevel = iPod.volume; You need to import the MediaPlayer framework. This works fine: Float32 volume; UInt32 dataSize = sizeof(Float32);

How to get audio volume level, and volume changed notifications on iOS?

大兔子大兔子 提交于 2019-11-26 18:24:00
I'm writing a very simple application that plays a sound when pressing a button. Since that button does not make a lot of sense when the device is set to silence I want to disable it when the device's audio volume is zero. (And subsequently reenable it when the volume is cranked up again.) I am seeking a working (and AppStore safe) way to detect the current volume setting and get a notification/callback when the volume level changes. I do not want to alter the volume setting. All this is implemented in my ViewController where said button is used. I've tested this with an iPhone 4 running iOS 4