Startup Command
Starting the container is to start the main process. However, some preparations must be made before the main process is started. For example, you may configure or initialize MySQL databases before running MySQL servers. You can set ENTRYPOINT or CMD in the Dockerfile when creating an image.
In the following Dockerfile, the ENTRYPOINT ["top", "-b"] command will be executed when the container is started.
FROM ubuntu ENTRYPOINT ["top", "-b"]
When calling an API, you only need to configure the containers.command parameter of the pod. This parameter is of the list type. The first parameter is the execution command, while the subsequent parameters are the command parameters.
apiVersion: v1
kind: Pod
metadata:
name: Ubuntu
spec:
containers:
- image: Ubuntu
name: container-0
resources:
limits:
cpu: 500m
memory: 1024Mi
requests:
cpu: 500m
memory: 1024Mi
command: # Startup command
- top
- "-b"
imagePullSecrets:
- name: imagepull-secret
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