collection is still in accordance with the Syslog or other old way, the mirror capacity is very large, the base image can reach 80M, which and Docker The idea was completely different, and the Alpine Linux distribution, as a lightweight Linux environment, was well suited as a docker base image, and Docker also recommended using Alpine instead of Debian as the base image, and a large number of existing offi
, the basic image can reach 80M, this and Docker The idea was completely different, and the Alpine Linux distribution, as a lightweight Linux environment, was ideal for Docker base mirroring, and Docker officially recommended using Alpine instead of Debian as a base image, and the future of a large number of existing official mirrors will be migrated to the Alpine
, log collection still follows Syslog or other old methods, the size of the image is very huge, and the basic image can reach 80 Mb, which is totally different from the idea proposed by Docker at the beginning. the Alpine Linux release is a lightweight Linux environment, as a basic Docker image, Docker officially recommends Alpine instead of Debian as the basic image. in the future, a large number of existi
This is a creation in
Article, where the information may have evolved or changed.
The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/53635529 not allowed to reprint without the Bo master.Bo main address is: Http://blog.csdn.net/freewebsys
1, about alpine environment
http://blog.csdn.net/freewebsys/article/details/53615757The HTTP server for the next Golang was studied yesterday.Found an error when booting:
fileord
This is a creation in
Article, where the information may have evolved or changed.
1, about alpine environment
The HTTP server for the next Golang was studied yesterday.
Found an error when booting:
No such file or directory
New Wisdom Cloud www.enncloud.cn found this error, began to think is Alpine system Lib library less,
You must use the official Docker Golang image.
Later the study understood that it
image, that is, Alpine. The size of the Alpine image is less than 4 MB, and the size of the application can be reduced to 20 mb.Dockerfile. Alpine? File:
From alpine:latest COPY ./httpserver /root/httpserver RUN chmod +x /root/httpserver WORKDIR /root ENTRYPOINT ["/root/httpserver"]
Create an Alpine application image
-KLMFZ 2/2 Running 7 23hkube-flannel-ds-ze30q 2/2 Running 4 23hkube-proxy-amd64-2yx0g 1 /1 Running 0 1dkube-proxy-amd64-hcj9t 1/1 Running 0 23hkube-pro Xy-amd64-vhevz 1/1 Running 0 23hkube-scheduler-localhost.localdomain 1/1 Running 1 1d
On node, you can see the network card information such as FLANNEL.1.
2. Verification
Save the following RC as Alpine.yaml.
apiVersion: v1kind: ReplicationControllermetadata: name: alpine labels: name:
time you pull a. NET image, you get updated software, an update to a. NET and/or underlying operating system, whether it's Windows or Linux.This new software delivery model is faster and creates stronger connections between software producers and consumers. It also gives you more control, but requires a bit more knowledge on how to get the software through Docker. It is important to understand the software vendor's Docker repositories (repos) and tags (tags)-this example of microsoft--so you ca
mirror, all processes running on the host, if interested can completely PS aux query, you can find in the Docker running process, but Docker do it as chroot The encapsulation of almost the concept.
Docker true Usage
In the early days of the Docker development, because of busybox and other lightweight mirrors are not complete, the major release of the reduction of thin mirror image has been more used, especially because Docker itself is developed in the Ubuntu environment, so Ubuntu and Debian
hours 0.0.0.0:81-gt ; 80/tcp MynginxB889bfd7a6ee marksugar/nginx:8.33 "/bin/bash" hours ago up 7 hours 0.0.0.0:80-gt ; 80/tcp Nginx[Root@gitlab conf]#
3, Mark and upload the mirror
Use Docker tag to mark a mirror with the following format:10.10.239.222:5000/alpine, where 10.10.239.222 is the local warehouse address, 5000 is the warehouse port, and Alpine is the mirrored labelThe 10.10.239.222 here can be
mirror, all processes running on the host, if interested can completely PS aux query, you can find in the Docker running process, but Docker do it as chroot The encapsulation of almost the concept.
Docker true Usage
In the early days of the Docker development, because of busybox and other lightweight mirrors are not complete, the major release of the reduction of thin mirror image has been more used, especially because Docker itself is developed in the Ubuntu environment, so Ubuntu and Debian
must be admitted that there is a slight deviation in the binary file. If you are using CGO, or if you are using net packages, the GO linker will generate a dynamic library. In this case, the net package (which does have many useful go programs!) ), the culprit is DNS resolution. Most systems have a fancy, modular name resolution system (like name service switching) that relies on plug-ins, technically, dynamic libraries. By default, go tries to use it, so it generates a dynamic library.
How do
users can easily learn how to use it with context-sensitive help.Importantly, it can be highly customizable with Alpine commands.# Alpine Installationwget ftp://ftp.cac.washington.edu/alpine/alpine.tar.gzTar zxvf alpine.tar.gz cd Alpine ./configure make make installNote: For more apline installation details, please
website: http://www.qmail.org5. MuttCommand line mail clientMutt is a UNIX-based operating system with a small and powerful email client.As a text-based e-mail client, it has some exciting features, notable features include:
Message subject
Support for IMAP and POP3 protocols
Supports multiple mailbox formats, such as Mbox,mh,maildir,mmdf
Support Delivery Status
Multiple message Tokens
Support Pgp/mime (RFC2015)
Various features to support mailing lists, includi
This is a creation in
Article, where the information may have evolved or changed.
1,alpine Linux is very small
First Alpine is very small, installed on the bash after the 5MB.Golang don't need any other dependencies to see if they can run on Alpine.Build a Golang environment, rather than putting the golang environment on the Alpine.
2, first build Golang envi
large file in the transmission is absolutely a disaster, next we use multi-stage to build a relatively small image.
Multi-stage Build image
Dockerfile:
FROM golang:1.10.3 as builderWORKDIR /go/src/testRUN go get github.com/gin-gonic/ginCOPY src srcRUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main src/main.goFROM alpine:3.8WORKDIR /rootCOPY --from=builder /go/src/test/main .CMD ["./main"]
Build
$ docker build-t ze
This is a creation in
Article, where the information may have evolved or changed.
The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/53744348 not allowed to reprint without the Bo master.Bo main address is: Http://blog.csdn.net/freewebsys
1, about the Java environment
If you use the official Docker Java environment, it will be very large 643.2 MB.And there's a lot of useless stuff in there. Not very good.Find an easy way to install directly using OPENJRE.Ins
, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.24, strippedsetting in. config CONFIG_STATIC_LINK=y will be statically compiledYou can view the kernel configuration used at compile time by compiling the vmlinux:./vmlinux --showconfigRootfsUse BusyBox to do rootfs:https://busybox.net/Configuration compilation:Make DefconfigMake MenuconfigSelect Busybox settings->1, build options->, select [*] Build Busybox as a static binary (no shared libs);If the compile-time dynamic link, comp
This is a creation in
Article, where the information may have evolved or changed.
Create the smallest and secured Golang Docker image based on scratch
When we were building a docker image, the first idea is using the default official image.
From Golangfrom Nginxfrom openjdk
There is a official Docker image for Go.
$ docker Image Listgolang latest 1c1309ff8e0d days ago 779MB
Ouch 779 MB Just for an empty image ... this is crazy
There is lightweight
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.