使用initContainers-更新您的deployment.yml,假设913617820371.dkr.ecr.us-west-2.amazonaws.com/nltk_data:latest
是您的数据映像
当您知道映像中包含的内容时,您需要选择适当的安装路径。我会用/mnt/nltk_data
spec: volumes: - name: shared-data emptyDir: {} initContainers: - name: init-ikg-api-demo imagePullPolicy: Always # You can use command, if you don't want to change the ENTRYPOINT command: ['sh', '-c', 'cp -r /nltk_data_source /mnt/nltk_data'] volumeMounts: - name: shared-data mountPath: /mnt/nltk_data image: 913617820371.dkr.ecr.us-west-2.amazonaws.com/nltk_data:latest containers: - name: ikg-api-demo imagePullPolicy: Always volumeMounts: - name: shared-data mountPath: /nltk_data image: 913xxx371.dkr.ecr.us-west-2.amazonaws.com/main_api:c56cefbd0c81142558cf814cba7d7cd75d7cb6a7 ports: - containerPort: 80