idoc 打包docker镜像
1 2 3 4
| FROM node WORKDIR /code RUN npm install idoc -g ENTRYPOINT idoc -w
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
| apiVersion: v1 kind: ConfigMap metadata: name: cloud-ide-config data: default.conf : | server { listen 80; listen [::]:80; server_name localhost;
location / { root /usr/share/nginx/html; index index.html index.htm; } }
--- apiVersion: apps/v1 kind: StatefulSet metadata: name: cloud-ide spec: selector: matchLabels: app: cloud-ide serviceName: "cloud-ide" replicas: 1 template: metadata: labels: app: cloud-ide spec: nodeSelector: type: public terminationGracePeriodSeconds: 10 containers: - name: cloud image: sapk/cloud9:latest imagePullPolicy: IfNotPresent ports: - containerPort: 8181 name: ide volumeMounts: - name: cloud mountPath: /workspace args: ['-a :'] - name: idoc image: myidoc:latest imagePullPolicy: IfNotPresent volumeMounts: - name: cloud mountPath: /code - name: nginx image: nginx:latest imagePullPolicy: IfNotPresent ports: - name: nginx containerPort: 80 volumeMounts: - name: cloud mountPath: /usr/share/nginx/html - name: cloud-ide-config mountPath: /etc/nginx/conf.d/ volumes: - name: cloud-ide-config configMap: name: cloud-ide-config volumeClaimTemplates: - metadata: name: cloud annotations: volume.beta.kubernetes.io/storage-class: test-nfs-storage spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 10Gi
---
apiVersion: v1 kind: Service metadata: name: cloud-svc labels: app: cloud-ide spec: ports: - name: cloud port: 8181 targetPort: 8181 - name: web port: 80 targetPort: 80 selector: app: cloud-ide
--- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: cloud-ingress namespace: default spec: rules: - host: doc.spzl http: paths: - path: / backend: serviceName: cloud-svc servicePort: 8181 - host: doc.spzl.web http: paths: - path: / backend: serviceName: cloud-svc servicePort: 80
|
-a username:password
指定用户名密码
-a
: 强制不登录