Configuring Dockerfile Parameters for CCI
Scenario
A Dockerfile is often used to build an image. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
This topic describes how to apply the Dockerfile configurations in CCI 2.0.
Using Dockerfile Parameters in CCI 2.0
The following uses an example to describe the relationship between Dockerfile parameters and CCI 2.0.
FROM ubuntu:16.04 ENV VERSION 1.0 VOLUME /var/lib/app EXPOSE 80 ENTRYPOINT ["./entrypoint.sh"] CMD ["start"]
In this example, the Dockerfile contains common parameters, including ENV, VOLUME, EXPOSE, ENTRYPOINT, and CMD. These parameters can be configured for CCI 2.0 as follows:
kind: Deployment apiVersion: cci/v2 metadata: name: wordpress spec: replicas: 1 selector: matchLabels: app: wordpress template: metadata: labels: app: wordpress spec: containers: - name: wordpress image: wordpress:latest command: [."/entrypoint.sh"] # ENTRYPOINT args: ["start"] # CMD ports: # EXPOSE - containerPort: 80 env: # ENV - name: VERSION value: "1.0" resources: limits: cpu: 500m memory: 1Gi requests: cpu: 500m memory: 1Gi volumeMounts: # VOLUME - name: cache-volume mountPath: /cache volumes: - name: cache-volume emptyDir: sizeLimit: 1Gi medium: Memory dnsPolicy: Default
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot