Last active
December 13, 2018 15:09
-
-
Save ecurtin/d4cd3eafe5fcadb8906752ec81b8c8e2 to your computer and use it in GitHub Desktop.
Revisions
-
Emily Curtin revised this gist
Dec 13, 2018 . 1 changed file with 53 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ docker build -t registry.ng.bluemix.net/gaq-workshops/trivial-http:latest ./ docker image history registry.ng.bluemix.net/gaq-workshops/trivial-http:latest docker run -p 1234:1234 --detach registry.ng.bluemix.net/gaq-workshops/trivial-http:latest curl localhost:1234 curl localhost:1234 --- docker image ls docker container ls # grab the id of the running container docker exec -it <CONTAINER ID> sh --- # inside container ls ps -ef cat index.html echo "somethin different" > index.html cat index.html # outside container curl localhost:1234 docker kill <CONTAINER ID> --- docker run -p 1234:1234 --detach registry.ng.bluemix.net/gaq-workshops/trivial-http:latest curl localhost:1234 --- # inside container ls cat index.html --- # The following commands require ICM Cloud account setup and cluster access docker push registry.ng.bluemix.net/gaq-workshops/trivial-http:latest kubectl apply -f trivial-deployment.yaml kubectl apply -f trivial-service.yaml kubectl apply -f trivial-ingress.yaml kubectl get pods kubectl describe pod <POD NAME> kubectl get svc kubectl get ing -
Emily Curtin created this gist
Dec 13, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ # An utterly trivial webserver for Docker experimentation # To build and run: # docker build -t registry.ng.bluemix.net/gaq-workshops/trivial-http:latest ./ # docker run -p 1234:1234 --detach registry.ng.bluemix.net/gaq-workshops/trivial-http:latest # curl localhost:1234 # To kill off: # docker container ls # docker kill <container id> FROM busybox:latest EXPOSE 1234 RUN echo "congratz u can haz http" > index.html CMD ["busybox", "httpd", "-f", "-p", "1234"] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ apiVersion: apps/v1 kind: Deployment metadata: name: busybox-demo labels: app: busybox-demo spec: replicas: 1 selector: matchLabels: app: busybox-demo template: metadata: labels: app: busybox-demo spec: containers: - name: trivial-demo image: registry.ng.bluemix.net/gaq-workshops/trivial-http:latest ports: - containerPort: 1234 imagePullSecrets: - name: emily-cr-secret This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ apiVersion: v1 kind: Service metadata: name: busybox-demo spec: selector: app: busybox-demo ports: - protocol: TCP port: 80 targetPort: 1234 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ apiVersion: apps/v1 kind: Deployment metadata: name: busybox-demo labels: app: busybox-demo spec: replicas: 1 selector: matchLabels: app: busybox-demo template: metadata: labels: app: busybox-demo spec: containers: - name: trivial-demo image: registry.ng.bluemix.net/gaq-workshops/trivial-http:latest ports: - containerPort: 1234 imagePullSecrets: - name: emily-cr-secret