Cloud technologies repository, semester IV.
ps -a- show all containerspull- download docker imagerun- create a container from an imagestart -a- start container with input/output signalsrm- delete a stopped containerrmi- delete imagestop- stop containerkill- force stopprune- ???
run -it- create container and start with input/output signalslogs- get logs from containerexec- access the running container / execute the command inside the containercreate- create container
build -f filename .- build custom docker image with namefilename
FROM node:14
WORKDIR /usr/src/my_node_app
COPY ./package.json ./
RUN npm i
COPY ./index.js ./
EXPOSE 8080
CMD node index.js
FROM- set the base imageWORKDIR- set the working directoryCOPY- copy files or folders from source to the dest pathRUN- execute any commands on top of the current imageEXPOSE- define the network ports that this container will listen on at runtimeCMD- provide defaults for an executing container, there can only be one CMD instruction in a Dockerfile
network create name- creates a new networknetwork ls- lists all the networks the docker knows aboutnetwork rm name- removes one or more networks by name or identifiernetwork inspect name- returns information about one or more networksdocker network connect NETWORK CONTAINER- connects a container to a network
docker-compose up- builds, starts, and attaches to containers for a servicedocker-compose up -d- run containers in the backgrounddocker-compose stop- stops running containers without removing themdocker-compose down --volumes- stops containers and remove named volumes declared in the volumes section of the Compose file
run -p local-port:server-port- port mappingrun -v- mapping directoriesexec -it ID sh- run container shellnetwork ls- show networkingnetwork inspect- show extra detailsnetwork create NAME- create own docker network
get pods- prints a table of the most important information about the specified resourcesget all- prints alldescribe TYPE NAME- will print debug information about the given resourcecreate -f NAME- create a resource from a file or from stdindelete TYPE NAME- delete resources by file namesapply -f NAME- apply a configuration to a resource by file name or stdinscale --replicas=XXX -f NAME- set a new size for a deploymentlogs -f NAME- print the logs for a container in a pod or specified resourceexec -it NAME -- COMMAND- execute a command in a container
- pod
- replicaset
- deployment
- nodeport
- configmaps
- more
ip addr- IP checking