欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Docker Machine安装及入门

程序员文章站 2022-04-14 13:41:55
...

安装VMware Workstation Pro
安装Centos7
安装Oracle VM VirtualBox
参考之前的文章:
https://blog.csdn.net/xp0406/article/details/104571741

安装docker-machine

版本号更加情况修改,我使用V0.16.0

base=https://github.com/docker/machine/releases/download/v0.16.0 &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
install /tmp/docker-machine /usr/local/bin/docker-machine

创建虚拟机


docker-machine create --driver virtualbox default

[aaa@qq.com ~]# docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER    ERRORS
default   -        virtualbox   Stopped                 Unknown 

[aaa@qq.com ~]# docker-machine start default
Starting "default"...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
[aaa@qq.com ~]# docker-machine ssh default
   ( '>')
  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY.
 (/-_--_-\)           www.tinycorelinux.net

aaa@qq.com:~$ uname
Linux
aaa@qq.com:~$ uname -a                                                     
Linux default 4.14.154-boot2docker #1 SMP Thu Nov 14 19:19:08 UTC 2019 x86_64 GNU/Linux
aaa@qq.com:~$         

Docker-machine常用命令

docker-machine命令:
help 查看帮助信息

active 查看活动的Docker主机
config 输出连接的配置信息
create 创建一个Docker主机
env 显示连接到某个主机需要的环境变量
inspect 输出主机更新信息
ip 获取Docker主机地址
kill 停止某个Docker主机
ls 列出所有管理的Docker主机
regenerate-certs 为某个主机重新成功TLS认证信息
restart 重启Docker主机
rm 删除Docker主机
scp 在Docker主机之间复制文件
ssh SSH到主机上执行命令
start 启动一个主机
status 查看一个主机状态
stop 停止一个主机
upgrade 更新主机Docker版本为最新
url 获取主机的URL

Windows10下VirtualBox6安装扩展功能问题解决记录

存在的问题:

Could not mount the media/drive ‘D:\ProgramFiles\Oracle\VirtualBox\VBoxGuestAdditions.iso’ (VERR_PDM_MEDIA_LOCKED).
安装增强功能错误。
Docker Machine安装及入门

解决办法:

设备–分配光驱,强制释放
Docker Machine安装及入门
再次安装即可。

共享目录无法挂载
Docker Machine安装及入门

[aaa@qq.com log]# /run/media/root/VBox_GAs_6.1.2/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.2 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.1.2 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 
4.18.0-147.5.1.el8_1.x86_64.



ValueError: File context for /opt/VBoxGuestAdditions-6.1.2/other/mount.vboxsf already defined
VirtualBox Guest Additions: Running kernel modules will not be replaced until 
the system is restarted

Docker Machine安装及入门

共享文件件配置:
Docker Machine安装及入门
出现共享文件件,方便拷贝文件。


Docker Machine安装及入门

重启试试是否可以拷贝文件。

还是不能复制,粘贴。结束,先暂时用共享文件夹。后面解决了再更新。。。。。。。。。。。。。。。。。

  • 解决复制、粘贴

更详细的文章:
https://blog.csdn.net/YouOops/article/details/88884645

相关标签: 容器技术