概述
文章目录
- 接(一):运行hello-world
- url:[官方入门教学](https://hub.docker.com/?overlay=onboarding)
- url:[网速慢解答](https://www.v2ex.com/t/348535#;)
接(一):运行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:官方入门教学
71027@DESKTOP-gwdsss MINGW64 /d/Program Files/Docker Toolbox
$ cd E:GitProjectsDockerdoodlecheers2019 >
bash: cd: E:GitProjectsDockerdoodlecheers2019: No such file or directory
71027@DESKTOP-gwdsss MINGW64 /d/Program Files/Docker Toolbox
$ cd E:GitProjectsDockerdoodlecheers2019
bash: cd: E:GitProjectsDockerdoodlecheers2019: No such file or directory
71027@DESKTOP-gwdsss MINGW64 /d/Program Files/Docker Toolbox
$ cd 'E:GitProjectsDockerdoodlecheers2019'
71027@DESKTOP-gwdsss 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= T A R G E T O S G O A R C H = TARGETOS GOARCH= TARGETOSGOARCH=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
最后
以上就是热情石头为你收集整理的Docker学习与运行(二)接(一):运行hello-worldurl:官方入门教学url:网速慢解答的全部内容,希望文章能够帮你解决Docker学习与运行(二)接(一):运行hello-worldurl:官方入门教学url:网速慢解答所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复