docker save <repository>:<tag> -o <repository>.tar
docker save mysql:latest -o mysql.tar
docker load < mysql.tar
docker-compose -f mysql-deploy.yml up/down
apiVersion: v1 kind: ReplicationController metadata: name: mysql-rc labels: name: mysql-rc spec: replicas: 1 selector: name: mysql-pod template: metadata: labels: name: mysql-pod spec: containers: - name: mysql image: mysql imagePullPolicy: IfNotPresent ports: - containerPort: 3306 env: - name: MYSQL_ROOT_PASSWORD value: "mysql" --- apiVersion: v1 kind: Service metadata: name: mysql-svc labels: name: mysql-svc spec: type: NodePort ports: - port: 3306 protocol: TCP targetPort: 3306 name: http nodePort: 33306 selector: name: mysql-pod
原文地址:https://www.cnblogs.com/xinfang520/p/11698319.html
时间: 2024-11-06 07:08:52