Docker学习与运行(二)
文章目录
接(一):运行hello-world
(2020-1-8 8:01:23)
Starting "default"...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
(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.
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): Regenerating TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com
Start interactive shell
url:官方入门教学
aaa@qq.com MINGW64 /d/Program Files/Docker Toolbox
$ cd E:\GitProjects\Docker\doodle\cheers2019\ >
bash: cd: E:GitProjectsDockerdoodlecheers2019: No such file or directory
aaa@qq.com MINGW64 /d/Program Files/Docker Toolbox
$ cd E:\GitProjects\Docker\doodle\cheers2019
bash: cd: E:GitProjectsDockerdoodlecheers2019: No such file or directory
aaa@qq.com MINGW64 /d/Program Files/Docker Toolbox
$ cd 'E:\GitProjects\Docker\doodle\cheers2019'
aaa@qq.com MINGW64 /e/GitProjects/Docker/doodle/cheers2019 (master)
$ docker build -t gwdsss/cheers2019 .
Sending build context to Docker daemon 13.31kB
Step 1/9 : FROM golang:1.11-alpine AS builder
1.11-alpine: Pulling from library/golang
9d48c3bd43c5: Pull complete
7f94eaf8af20: Pull complete 9fe9984849c1: Pull complete ec448270508e: Downloading [====> ] 9.051MB/110.3MB 65ba82af53f7: Download complete
等待.
右击可以刷新查看进度.
网络.可能炸了.等待.
16.61MB/110.3MB
(2020-1-8 8:28:27)
这么久下载了16M.想修改配置.
或者等待.
url:网速慢解答
那么(2020-1-8 8:44:08)
查看.这个文件.
看readme.md
docker run -it --rm docker/doodle:cheers
不同的说法?对比官网.是下一步.
打开Dockerfile
FROM golang:1.11-alpine AS builder
RUN apk add --no-cache git
RUN go get github.com/pdevine/go-asciisprite
WORKDIR /project
COPY cheers.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags ‘-extldflags “-static”’ -o cheers cheers.go
FROM scratch
COPY --from=builder /project/cheers /cheers
ENTRYPOINT ["/cheers"]
另外两个文件
安装提示的插件
文件一
FROM --platform=$BUILDPLATFORM golang:1.11-alpine AS builder
RUN apk add --no-cache git
RUN go get github.com/pdevine/go-asciisprite
WORKDIR /project
COPY cheers.go .
ARG TARGETOS
ARG TARGETARCH
ENV GOOS=TARGETARCH
RUN CGO_ENABLED=0 go build -a -ldflags ‘-extldflags “-static”’ -o cheers cheers.go
FROM scratch AS release-linux
COPY --from=builder /project/cheers /cheers
ENTRYPOINT ["/cheers"]
FROM mcr.microsoft.com/windows/nanoserver:1809 AS release-windows
COPY --from=builder /project/cheers /cheers.exe
ENTRYPOINT ["\cheers.exe"]
FROM release-$TARGETOS
安装
漫长的代码.
发布.等待下一篇继续写.(2020-1-8 8:59:00)
洗漱.起床.撸代码9:30-10:30
上一篇: Uipath自动化.操作.学习.
推荐阅读
-
java学习心得系列(二):基本数据类型与一些规范
-
Java多线程高并发学习笔记(二)——深入理解ReentrantLock与Condition
-
Nordic nRF5 SDK 学习笔记之二, 蓝牙主机与从机建立联结及服务发现过程
-
数据结构与算法学习十五:常用查找算法介绍,线性排序、二分查找(折半查找)算法、差值查找算法、斐波那契(黄金分割法)查找算法
-
第二部分:如何在Docker容器中安装,运行和删除应用程序
-
深度学习花书 笔记3 - 矩阵对角化、奇异值分解(SVD)、极大似然估计、误差的高斯分布与最小二乘估计的等价性、PCA原理与推导
-
深度纸质学习与实验(二)-真机搭建docker与kubernetes(补更)
-
[Docker6] Docker compose多容器运行与管理
-
机器学习的数学基础加强(二)—— 概率论与贝叶斯先验
-
java9学习系列之在docker中如何运行java9