关键字 |
---|
alpine、scratch、curl、镜像、最小 |
1、Dockerfile如下
FROM alpine:latest
RUN apk add --update curl && rm -rf /var/cache/apk/*
2、pods文件例子
apiVersion: apps/v1
kind: Deployment
metadata:
name: ddtest-group-deploy
labels:
app: ddtest-group
spec:
replicas: 3
selector:
matchLabels:
app: ddtest-group
template:
metadata:
labels:
app: ddtest-group
spec:
initContainers:
- image: your-image-url:tag
name: ddtest-go
command: ["cp", "/ddtest", "/app"]
volumeMounts:
- mountPath: /app
name: app-volume
containers:
- image: your-image-url:tag
name: nginx-go
command: ["/app/ddtest"]
volumeMounts:
- mountPath: /app
name: app-volume
ports:
- containerPort: 8080
volumes:
- name: app-volume
emptyDir: {}