Docker for windows : 安装linux

时间:2021-10-16 19:58:04

一、Linux

1、拉取镜像

docker pull hub.c..com/library/oraclelinux:latest

2、创建linux容器

C:\Users\K-Jso>docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
hub.c..com/library/php 7.1 6cd3037a948f months ago 371MB
hub.c..com/library/oraclelinux latest 9fe41720f939 months ago 229MB
hub.c..com/library/redis 4.0. d4f259423416 months ago 106MB
hub.c..com/library/nginx latest 46102226f2fd months ago 109MB
hub.c..com/library/mysql 5.6 0977f3a915e5 months ago 298MB C:\Users\K-Jso>docker run --name linux -it -d 9fe41720f939 /bin/bash
04d7d2d30543f983fdd329f6f23d235b2229291063211e1a5f514636f26310e3

3、运行容器,进入容器进行交互(我使用vscode docker 插件进行管理)

Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。 PS D:\SMZDM\projects\new_crm> docker exec -it 04d7d2d30543f983fdd329f6f23d235b2229291063211e1a5f514636f26310e3 /bin/sh
sh-4.2# /bin/bash
[root@04d7d2d30543 /]#
[root@6c9853a071ef /]# ll
total
lrwxrwxrwx root root Aug bin -> usr/bin
dr-xr-xr-x root root Aug boot
drwxr-xr-x root root Jun : dev
drwxr-xr-x root root Jun : etc
drwxr-xr-x root root Aug home
lrwxrwxrwx root root Aug lib -> usr/lib
lrwxrwxrwx root root Aug lib64 -> usr/lib64
drwxr-xr-x root root Aug media
drwxr-xr-x root root Aug mnt
drwxr-xr-x root root Aug opt
dr-xr-xr-x root root Jun : proc
dr-xr-x--- root root Aug root
drwxr-xr-x root root Aug run
lrwxrwxrwx root root Aug sbin -> usr/sbin
drwxr-xr-x root root Aug srv
dr-xr-xr-x root root Jun : sys
drwxrwxrwt root root Aug tmp
drwxr-xr-x root root Aug usr
drwxr-xr-x root root Aug var
[root@6c9853a071ef /]#