basic node web app, from git, dockerised and used in kubenetes
2.6K
local files -> git: frankc60/hello-world -> git workflow -> hub.docker (frankc60/hello-world)
create this nodejs app
create a "dockerfile", insert contents.
put in a .dockerignore file, with: node_modules
build the image: sudo docker build . -t frankc60/hello-world
check image is created with: sudo docker images
run the image in background: sudo docker run -p 8080:3000 -d frankc60/hello-world
(-p : for example EXPOSE 3000 (from dockerfile), so would use: -p 8080:3000 - to open port 8080 to network, via http://localhost:8080)
check app is running in background: sudo docker ps (to get the containerID) sudo docker logs
if you need to go into container: sudo docker exec -it /bin/bash
access from cmdline: curl http://localhost:8080
--Put into Kubernetes--
create a pod.yaml file
create a service.yaml file
kubectl create -f pod.yaml kubectl get pods
kubectl create -f service.yaml kubectl get svc
Content type
Image
Digest
Size
53 MB
Last updated
about 5 years ago
docker pull frankc60/hello-world:39