Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
2019-11-18 03:52:01.912 INFO 1 --- [ main] hello.Application : Starting Application v0.1.0 on 12cf47053074 with PID 1 (/app.jar started by root in /) ...
如果你想看看镜像的内部结构,可以执行:
1 2 3 4 5
docker run -ti --entrypoint /bin/sh myorg/myapp / # ls app.jar dev home media opt root sbin sys usr bin etc lib mnt proc run srv tmp var / #
$ docker run -p 8080:8080 -t ljun51/gs-spring-boot-docker .... 2015-03-31 13:25:48.035 INFO 1 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http) 2015-03-31 13:25:48.037 INFO 1 --- [ main] hello.Application : Started Application in 5.613 seconds (JVM running for 7.293)
查看正在运行的docker容器:
1 2 3
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 01cae1671836 ljun51/gs-spring-boot-docker "java -cp app:app/li…" 22 seconds ago Up 21 seconds 0.0.0.0:8080->8080/tcp elated_cori
DESCRIPTION: Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.
FIELDS: apiVersion <string> APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind <string> Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata <Object> Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec <Object> Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status <Object> Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
要了解二级对象或三级对象的资源时:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
$ kubectl explain pods.spec KIND: Pod VERSION: v1
RESOURCE: spec <Object>
DESCRIPTION: Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
PodSpec is a description of a pod.
FIELDS: ...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
$ kubectl explain pods.spec.containers KIND: Pod VERSION: v1
RESOURCE: containers <[]Object>
DESCRIPTION: List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.
A single application container that you want to run within a pod.
FIELDS: ...
还有一种方式可以快速定义资源文件,即参考现有的资源配置。比如:
1
kubectl get pods open-user-74b8b67bc9-kgkxx -o yaml --export > pods-demo.yaml