docker容器修改挂载路径

这篇具有很好参考价值的文章主要介绍了docker容器修改挂载路径。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

环境信息

虚拟机:appserver

说明

现有启动参数

$ docker run \
-d -p 8099:8080 -p 50099:50000 \
-v /appdata/jenkins:/var/jenkins_home \
--name jenkins \
jenkins/jenkins:2.346.3-2-jdk8

调整后启动参数

# docker启动Jenkins
$ docker run \
-v /appdata/jenkins:/var/jenkins_home \
-v /usr/bin/docker:/usr/bin/docker \
-v /var/run/docker.sock:/var/run/docker.sock \
-u root \
-d --name jenkins \
-p 8099:8080 -p 50099:50000 \
jenkins/jenkins:2.346.3-2-jdk8

新增参数说明
挂载宿主机docker-cli、docker.sock到Jenkins中

  1. 宿主机docker-cli路径/usr/bin/docker
  2. 宿主机docker.sock路径/var/run/docker.sock

docker修改挂载路径

配置文件位置

$ systemctl stop docker
$ systemctl stop docker.socket
$ cd /var/lib/docker/containers
$ ls -al |grep 8685eaddcd52      # 8685eaddcd52为容器id,获得容器完整路径
drwx--x---.  4 root root  273 May  1 06:39 8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900
$ cd  8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900
$ ls -al
total 2416
drwx--x---. 4 root root    4096 May  3 17:13 .
drwx--x---. 9 root root    4096 May  3 16:50 ..
-rw-r-----. 1 root root 2425836 May  3 17:14 8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900-json.log
drwx------. 2 root root       6 Oct  7  2022 checkpoints
-rw-------  1 root root    4664 May  3 17:13 config.v2.json
-rw-r--r--  1 root root    1601 May  3 17:13 hostconfig.json
-rw-r--r--. 1 root root      13 May  3 17:13 hostname
-rw-r--r--. 1 root root     174 May  3 17:13 hosts
drwx--x---. 2 root root       6 Oct  7  2022 mounts
-rw-r--r--. 1 root root      54 May  3 17:13 resolv.conf
-rw-r--r--  1 root root      71 May  3 17:13 resolv.conf.hash

修改配置文件hostconfig.json

$ cp hostconfig.json hostconfig.json.bak
$ vi hostconfig.json

修改前:
关键点

“Binds”:[“/appdata/jenkins:/var/jenkins_home”]

完整版

{"Binds":["/appdata/jenkins:/var/jenkins_home"],"ContainerIDFile":"","LogConfig":{"Type":"json-file","Config":{}},"NetworkMode":"default","PortBindings":{"50000/tcp":[{"HostIp":"","HostPort":"50099"}],"8080/tcp":[{"HostIp":"","HostPort":"8099"}]},"RestartPolicy":{"Name":"always","MaximumRetryCount":0},"AutoRemove":false,"VolumeDriver":"","VolumesFrom":null,"CapAdd":null,"CapDrop":null,"CgroupnsMode":"host","Dns":[],"DnsOptions":[],"DnsSearch":[],"ExtraHosts":null,"GroupAdd":null,"IpcMode":"private","Cgroup":"","Links":null,"OomScoreAdj":0,"PidMode":"","Privileged":false,"PublishAllPorts":false,"ReadonlyRootfs":false,"SecurityOpt":null,"UTSMode":"","UsernsMode":"","ShmSize":67108864,"Runtime":"runc","ConsoleSize":[0,0],"Isolation":"","CpuShares":0,"Memory":0,"NanoCpus":0,"CgroupParent":"","BlkioWeight":0,"BlkioWeightDevice":[],"BlkioDeviceReadBps":null,"BlkioDeviceWriteBps":null,"BlkioDeviceReadIOps":null,"BlkioDeviceWriteIOps":null,"CpuPeriod":0,"CpuQuota":0,"CpuRealtimePeriod":0,"CpuRealtimeRuntime":0,"CpusetCpus":"","CpusetMems":"","Devices":[],"DeviceCgroupRules":null,"DeviceRequests":null,"KernelMemory":0,"KernelMemoryTCP":0,"MemoryReservation":0,"MemorySwap":0,"MemorySwappiness":null,"OomKillDisable":false,"PidsLimit":null,"Ulimits":null,"CpuCount":0,"CpuPercent":0,"IOMaximumIOps":0,"IOMaximumBandwidth":0,"MaskedPaths":["/proc/asound","/proc/acpi","/proc/kcore","/proc/keys","/proc/latency_stats","/proc/timer_list","/proc/timer_stats","/proc/sched_debug","/proc/scsi","/sys/firmware"],"ReadonlyPaths":["/proc/bus","/proc/fs","/proc/irq","/proc/sys","/proc/sysrq-trigger"]}

修改后:
关键点

“Binds”:[“/appdata/jenkins:/var/jenkins_home”,“/usr/bin/docker:/usr/bin/docker”,“/var/run/docker.sock:/var/run/docker.sock”]

完整版

{"Binds":["/appdata/jenkins:/var/jenkins_home","/usr/bin/docker:/usr/bin/docker","/var/run/docker.sock:/var/run/docker.sock"],"ContainerIDFile":"","LogConfig":{"Type":"json-file","Config":{}},"NetworkMode":"default","PortBindings":{"50000/tcp":[{"HostIp":"","HostPort":"50099"}],"8080/tcp":[{"HostIp":"","HostPort":"8099"}]},"RestartPolicy":{"Name":"always","MaximumRetryCount":0},"AutoRemove":false,"VolumeDriver":"","VolumesFrom":null,"CapAdd":null,"CapDrop":null,"CgroupnsMode":"host","Dns":[],"DnsOptions":[],"DnsSearch":[],"ExtraHosts":null,"GroupAdd":null,"IpcMode":"private","Cgroup":"","Links":null,"OomScoreAdj":0,"PidMode":"","Privileged":false,"PublishAllPorts":false,"ReadonlyRootfs":false,"SecurityOpt":null,"UTSMode":"","UsernsMode":"","ShmSize":67108864,"Runtime":"runc","ConsoleSize":[0,0],"Isolation":"","CpuShares":0,"Memory":0,"NanoCpus":0,"CgroupParent":"","BlkioWeight":0,"BlkioWeightDevice":[],"BlkioDeviceReadBps":null,"BlkioDeviceWriteBps":null,"BlkioDeviceReadIOps":null,"BlkioDeviceWriteIOps":null,"CpuPeriod":0,"CpuQuota":0,"CpuRealtimePeriod":0,"CpuRealtimeRuntime":0,"CpusetCpus":"","CpusetMems":"","Devices":[],"DeviceCgroupRules":null,"DeviceRequests":null,"KernelMemory":0,"KernelMemoryTCP":0,"MemoryReservation":0,"MemorySwap":0,"MemorySwappiness":null,"OomKillDisable":false,"PidsLimit":null,"Ulimits":null,"CpuCount":0,"CpuPercent":0,"IOMaximumIOps":0,"IOMaximumBandwidth":0,"MaskedPaths":["/proc/asound","/proc/acpi","/proc/kcore","/proc/keys","/proc/latency_stats","/proc/timer_list","/proc/timer_stats","/proc/sched_debug","/proc/scsi","/sys/firmware"],"ReadonlyPaths":["/proc/bus","/proc/fs","/proc/irq","/proc/sys","/proc/sysrq-trigger"]}

修改配置文件config.v2.json

$ cp config.v2.json config.v2.json.bak
$ vi config.v2.json

修改前:
关键内容

"MountPoints": {
  "/var/jenkins_home": {
    "Source": "/appdata/jenkins",
    "Destination": "/var/jenkins_home",
    "RW": true,
    "Name": "",
    "Driver": "",
    "Type": "bind",
    "Propagation": "rprivate",
    "Spec": {
      "Type": "bind",
      "Source": "/appdata/jenkins",
      "Target": "/var/jenkins_home"
    },
    "SkipMountpointCreation": false
  }
}

完整版

{"StreamConfig":{},"State":{"Running":false,"Paused":false,"Restarting":false,"OOMKilled":false,"RemovalInProgress":false,"Dead":false,"Pid":0,"ExitCode":143,"Error":"","StartedAt":"2023-05-03T09:00:59.247569407Z","FinishedAt":"2023-05-03T09:01:03.115883452Z","Health":null},"ID":"8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900","Created":"2022-10-07T05:43:24.764924571Z","Managed":false,"Path":"/usr/bin/tini","Args":["--","/usr/local/bin/jenkins.sh"],"Config":{"Hostname":"8685eaddcd52","Domainname":"","User":"jenkins","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"ExposedPorts":{"50000/tcp":{},"8080/tcp":{}},"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","LANG=C.UTF-8","JENKINS_HOME=/var/jenkins_home","JENKINS_SLAVE_AGENT_PORT=50000","REF=/usr/share/jenkins/ref","JENKINS_VERSION=2.346.3","JENKINS_UC=https://updates.jenkins.io","JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental","JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals","COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log","JAVA_HOME=/opt/java/openjdk"],"Cmd":null,"Image":"jenkins/jenkins:2.346.3-2-jdk8","Volumes":{"/var/jenkins_home":{}},"WorkingDir":"","Entrypoint":["/usr/bin/tini","--","/usr/local/bin/jenkins.sh"],"OnBuild":null,"Labels":{"org.opencontainers.image.description":"The Jenkins Continuous Integration and Delivery server","org.opencontainers.image.licenses":"MIT","org.opencontainers.image.revision":"4c18c51dfed0575dcc6a9220a6475a71c419dac1","org.opencontainers.image.source":"https://github.com/jenkinsci/docker","org.opencontainers.image.title":"Official Jenkins Docker image","org.opencontainers.image.url":"https://www.jenkins.io/","org.opencontainers.image.vendor":"Jenkins project","org.opencontainers.image.version":"2.346.3"}},"Image":"sha256:0e48d93a1a731b327c9d8ea1af728563c3b40db5af4d409bfaab1a38d0ed0ede","NetworkSettings":{"Bridge":"","SandboxID":"99ec7f9c506b640ceb1bf02137cbed7ae61ca9e58026134c5a24cc926f78e77c","HairpinMode":false,"LinkLocalIPv6Address":"","LinkLocalIPv6PrefixLen":0,"Networks":{"bridge":{"IPAMConfig":null,"Links":null,"Aliases":null,"NetworkID":"d908aba67e9a28304393f876c69d5610c8fcca64cb865805d9d4144fbe45ccb8","EndpointID":"","Gateway":"","IPAddress":"","IPPrefixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"","DriverOpts":null,"IPAMOperational":false}},"Service":null,"Ports":null,"SandboxKey":"/var/run/docker/netns/99ec7f9c506b","SecondaryIPAddresses":null,"SecondaryIPv6Addresses":null,"IsAnonymousEndpoint":false,"HasSwarmEndpoint":false},"LogPath":"/var/lib/docker/containers/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900-json.log","Name":"/jenkins","Driver":"overlay2","OS":"linux","MountLabel":"","ProcessLabel":"","RestartCount":0,"HasBeenStartedBefore":true,"HasBeenManuallyStopped":false,"MountPoints":{"/var/jenkins_home":{"Source":"/appdata/jenkins","Destination":"/var/jenkins_home","RW":true,"Name":"","Driver":"","Type":"bind","Propagation":"rprivate","Spec":{"Type":"bind","Source":"/appdata/jenkins","Target":"/var/jenkins_home"},"SkipMountpointCreation":false}},"SecretReferences":null,"ConfigReferences":null,"AppArmorProfile":"","HostnamePath":"/var/lib/docker/containers/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900/hostname","HostsPath":"/var/lib/docker/containers/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900/hosts","ShmPath":"","ResolvConfPath":"/var/lib/docker/containers/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900/resolv.conf","SeccompProfile":"","NoNewPrivileges":false,"LocalLogCacheMeta":{"HaveNotifyEnabled":false}}

修改后:
关键版

"MountPoints": {
  "/var/jenkins_home": {
    "Source": "/appdata/jenkins",
    "Destination": "/var/jenkins_home",
    "RW": true,"Name": "",
    "Driver": "",
    "Type": "bind",
    "Propagation": "rprivate",
    "Spec": {
      "Type": "bind",
      "Source": "/appdata/jenkins",
      "Target": "/var/jenkins_home"
    },
    "SkipMountpointCreation": false
  },
  "/usr/bin/docker": {
    "Source": "/usr/bin/docker",
    "Destination": "/usr/bin/docker",
    "RW": true,"Name": "",
    "Driver": "",
    "Type": "bind",
    "Propagation": "rprivate",
    "Spec": {
      "Type": "bind",
      "Source": "/usr/bin/docker",
      "Target": "/usr/bin/docker"
    },
    "SkipMountpointCreation": false
  },
  "/var/run/docker.sock": {
    "Source": "/var/run/docker.sock",
    "Destination": "/var/run/docker.sock",
    "RW": true,
    "Name": "",
    "Driver": "",
    "Type": "bind",
    "Propagation": "rprivate",
    "Spec": {
      "Type": "bind",
      "Source": "/var/run/docker.sock",
      "Target": "/var/run/docker.sock"
    },"SkipMountpointCreation": false
  }
}

完整版

{"StreamConfig":{},"State":{"Running":false,"Paused":false,"Restarting":false,"OOMKilled":false,"RemovalInProgress":false,"Dead":false,"Pid":0,"ExitCode":143,"Error":"","StartedAt":"2023-05-03T09:00:59.247569407Z","FinishedAt":"2023-05-03T09:01:03.115883452Z","Health":null},"ID":"8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900","Created":"2022-10-07T05:43:24.764924571Z","Managed":false,"Path":"/usr/bin/tini","Args":["--","/usr/local/bin/jenkins.sh"],"Config":{"Hostname":"8685eaddcd52","Domainname":"","User":"jenkins","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"ExposedPorts":{"50000/tcp":{},"8080/tcp":{}},"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","LANG=C.UTF-8","JENKINS_HOME=/var/jenkins_home","JENKINS_SLAVE_AGENT_PORT=50000","REF=/usr/share/jenkins/ref","JENKINS_VERSION=2.346.3","JENKINS_UC=https://updates.jenkins.io","JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental","JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals","COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log","JAVA_HOME=/opt/java/openjdk"],"Cmd":null,"Image":"jenkins/jenkins:2.346.3-2-jdk8","Volumes":{"/var/jenkins_home":{}},"WorkingDir":"","Entrypoint":["/usr/bin/tini","--","/usr/local/bin/jenkins.sh"],"OnBuild":null,"Labels":{"org.opencontainers.image.description":"The Jenkins Continuous Integration and Delivery server","org.opencontainers.image.licenses":"MIT","org.opencontainers.image.revision":"4c18c51dfed0575dcc6a9220a6475a71c419dac1","org.opencontainers.image.source":"https://github.com/jenkinsci/docker","org.opencontainers.image.title":"Official Jenkins Docker image","org.opencontainers.image.url":"https://www.jenkins.io/","org.opencontainers.image.vendor":"Jenkins project","org.opencontainers.image.version":"2.346.3"}},"Image":"sha256:0e48d93a1a731b327c9d8ea1af728563c3b40db5af4d409bfaab1a38d0ed0ede","NetworkSettings":{"Bridge":"","SandboxID":"99ec7f9c506b640ceb1bf02137cbed7ae61ca9e58026134c5a24cc926f78e77c","HairpinMode":false,"LinkLocalIPv6Address":"","LinkLocalIPv6PrefixLen":0,"Networks":{"bridge":{"IPAMConfig":null,"Links":null,"Aliases":null,"NetworkID":"d908aba67e9a28304393f876c69d5610c8fcca64cb865805d9d4144fbe45ccb8","EndpointID":"","Gateway":"","IPAddress":"","IPPrefixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"","DriverOpts":null,"IPAMOperational":false}},"Service":null,"Ports":null,"SandboxKey":"/var/run/docker/netns/99ec7f9c506b","SecondaryIPAddresses":null,"SecondaryIPv6Addresses":null,"IsAnonymousEndpoint":false,"HasSwarmEndpoint":false},"LogPath":"/var/lib/docker/containers/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900-json.log","Name":"/jenkins","Driver":"overlay2","OS":"linux","MountLabel":"","ProcessLabel":"","RestartCount":0,"HasBeenStartedBefore":true,"HasBeenManuallyStopped":false,"MountPoints":{"/var/jenkins_home":{"Source":"/appdata/jenkins","Destination":"/var/jenkins_home","RW":true,"Name":"","Driver":"","Type":"bind","Propagation":"rprivate","Spec":{"Type":"bind","Source":"/appdata/jenkins","Target":"/var/jenkins_home"},"SkipMountpointCreation":false},"/usr/bin/docker":{"Source":"/usr/bin/docker","Destination":"/usr/bin/docker","RW":true,"Name":"","Driver":"","Type":"bind","Propagation":"rprivate","Spec":{"Type":"bind","Source":"/usr/bin/docker","Target":"/usr/bin/docker"},"SkipMountpointCreation":false},"/var/run/docker.sock":{"Source":"/var/run/docker.sock","Destination":"/var/run/docker.sock","RW":true,"Name":"","Driver":"","Type":"bind","Propagation":"rprivate","Spec":{"Type":"bind","Source":"/var/run/docker.sock","Target":"/var/run/docker.sock"},"SkipMountpointCreation":false}},"SecretReferences":null,"ConfigReferences":null,"AppArmorProfile":"","HostnamePath":"/var/lib/docker/containers/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900/hostname","HostsPath":"/var/lib/docker/containers/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900/hosts","ShmPath":"","ResolvConfPath":"/var/lib/docker/containers/8685eaddcd52f2f770526975a48a3ee6714eb9a0029cb5841a100ee3c84ae900/resolv.conf","SeccompProfile":"","NoNewPrivileges":false,"LocalLogCacheMeta":{"HaveNotifyEnabled":false}}

实验结果

[root@appserver ~]# docker ps -a |grep jenkins
8685eaddcd52   jenkins/jenkins:2.346.3-2-jdk8   "/usr/bin/tini -- /u…"   6 months ago   Up 25 minutes               0.0.0.0:8099->8080/tcp, :::8099->8080/tcp, 0.0.0.0:50099->50000/tcp, :::50099->50000/tcp      jenkins
[root@appserver ~]# docker exec -it 8685eaddcd52  /bin/bash
jenkins@8685eaddcd52:/$ ls -al /usr/bin/docker
-rwxr-xr-x. 1 root root 61811904 Oct  4  2021 /usr/bin/docker
jenkins@8685eaddcd52:/$ ls -al /var/run/docker.sock
srw-rw---- 1 root 985 0 May  3 09:13 /var/run/docker.sock

其他方式

Docker 修改容器参数文章来源地址https://www.toymoban.com/news/detail-771570.html

到了这里,关于docker容器修改挂载路径的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【Docker】在容器中管理数据&&数据卷挂载以及宿主机目录挂载

                                      🎉🎉欢迎来到我的CSDN主页!🎉🎉                         🏅我是平顶山大师,一个在CSDN分享笔记的博主。📚📚         🌟推荐给大家我的博客专栏《【Docker】在容器中管理数据》。🎯🎯                         🎁

    2024年01月16日
    浏览(46)
  • 当docker中容器运行时,如何将目录和宿主机进行挂载

    容器已运行,但还想挂载文件 容器已经运行起来了,突然想给容器的目录进行挂载,通常是在运行容器时加上 -v  命令 进行挂载。运行起来的容器想挂载文件夹可以通过修改容器在宿主机的配置文件进行解决。 在配置文件中加入新的挂载 1.查看容器存放目录 2.进入该目录

    2024年01月25日
    浏览(50)
  • docker 容器修改端口和目录映射

    一般在运行容器时,我们都会通过参数 -p(使用大写的-P参数则会随机选择宿主机的一个端口进行映射)来指定宿主机和容器端口的映射,例如 这里是将容器内的80端口映射到宿主机的8088端口 参数说明 -d 表示后台运行容器 -t 为docker分配一个伪终端并绑定到容器的标准输入上

    2024年04月26日
    浏览(53)
  • 如何修改 docker 容器的目录映射

    创建容器时,指定了目录映射(-v) 如果容器运行之后发现目录映射需要改怎么办? 方法一 删除原有容器,重新创建新的容器 删除容器 docker rm -f 容器ID/名字 重新创建容器 docker run -d -p 9999:8080 -i --name tomcat7 -v /usr/local/tomcat/webapps:/usr/local/tomcat/webapps tomcat:7 重新指定需要映射

    2024年02月16日
    浏览(40)
  • 解决docker通过volumes挂载文件,宿主机修改后容器内不同步,重启服务才能同步

    将文件的权限改为777,即 chmod 777 filename 。 详细解释在该文章: https://huaweicloud.csdn.net/633114e5d3efff3090b51a5a.html 说明: 这是由于linux系统文件挂载机制导致的。 docker通过volumes挂载文件到容器中,有以下两种方式: 1、挂载目录 2、挂载具体文件:并不是挂载了某个文件的路径,

    2024年03月10日
    浏览(80)
  • docker启动报错修改docker目录后报错Failed with result‘service-start-limit-hit‘,修改容器目录

    systemctl stop docker.socket systemctl stop docker sudo mount 192.168.50.30:/test /raid vim /etc/fstab 192.168.50.30:/test /share nfs vim /etc/docker/daemon. json { “bip”: “128.128.0.1/16”, “insecure-registries”: [“192.168.50.23:11010”], “data-root”: “/raid/docker” } docker.socket: Failed with result ‘service start limit-hit’. 解决

    2024年02月06日
    浏览(43)
  • Docker数据管理之三种方式- 数据卷(Volumes)- 挂载主机目录(Bind mounts)- 数据卷容器(Data Volume Containers)

    文章主人公:帅哥BUG😎 文章路人: 路人  🤨   路人  😛 😎: docker在容器中管理数据主要有三种方式哦~ 🤨:  啊!,我记得docker在容器中管理数据主要方式是这两种吧  - 数据卷(Volumes) - 挂载主机目录(Bind mounts)      😛:  额,主要的方式是这两种?我怎么记得是这

    2024年02月05日
    浏览(76)
  • docker 安装的mysql修改配置文件 一、先看一下容器绑定的配置文件目录在哪

    如图,mysql容器的配置文件映射在服务器  /opt/mysql_docker/conf目录下。所以想修改容器的配置文件内容,只需要修改 /opt/mysql_docker/conf中的配置文件。  二、发现 /opt/mysql_docker/conf 目录下没有文件。 三、进入mysql容器,复制mysql的配置文件内容 复制内容如下: 四、在服务器/op

    2024年02月11日
    浏览(45)
  • linux硬盘挂载(linux 修改某个磁盘挂载到新目录)

    在Linux操作系统中,挂载硬盘是将硬盘的分区或者整个硬盘与文件系统关联起来,使得我们可以通过文件系统访问硬盘中的数据。 确认硬盘信息 该命令会列出所有已连接到系统的硬盘设备及其分区信息。根据输出结果找到你要挂载的硬盘设备,记下设备路径,例如/dev/sda 新硬

    2024年02月05日
    浏览(50)
  • Oracle修改数据文件所在目录的挂载点小结

    如何修改Oracle数据库文件所在目录的挂载点名称。这里先简单介绍一下背景情况,这套数据库是刚搭建不久的一套Oracle 19c单机的UAT,数据库安装在/opt目录下,$ORACLE_HOME目录为/opt/oracle19c/product/19.3.0/db_1。由于前期挂盘,设置挂载点命名没有严格按规范操作,将数据文件和归档

    2024年01月25日
    浏览(39)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包