[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573414-105":53,"doc-detail-573414-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","docker-cheat-sheet-for-java-developers","DOCKER CHEAT SHEET - FOR JAVA DEVELOPERS","","Docker cheat sheet for Java developers, focused on practical command-line workflows for managing Docker images and containers. Covers listing images and containers, starting, stopping, killing, removing containers, viewing logs, and committing a container into an image. Includes Docker Compose commands for building, starting groups of containers, forcing recreation, pulling updates, following logs, and removing services. Also provides guidance for building Spring Boot and adding Oracle Java, plus common run parameters like ports, environment variables, volumes, and Dockerfile usage.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/docker-cheat-sheet-for-java-developers/573414/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/docker-cheat-sheet-for-java-developers/573414.png","ImageObject",442,249,{"name":88,"@type":89},"Pentious","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-18","2026-10-14",true,{"@type":98,"interactionType":99,"userInteractionCount":76},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"How do you list Docker images and running containers?","Question",{"text":108,"@type":109},"Use `docker images -a` to list images and `docker ps` to list running containers. Add `-a` to include stopped containers with `docker ps -a`.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"How do you stop and remove Docker containers?",{"text":113,"@type":109},"Stop containers with `docker stop \u003Ccontainer name>` or kill them with `docker kill \u003Ccontainer name>`. Remove stopped containers using `docker rm \u003Ccontainer name>` or remove multiple containers with `docker rm $(docker ps -a -q)`.",{"name":115,"@type":106,"acceptedAnswer":116},"What are the key Docker Compose commands shown in the sheet?",{"text":117,"@type":109},"Build containers with `docker-compose build`, start in detached mode with `docker-compose up -d`, fetch latest versions with `docker-compose pull`, and view logs with `docker-compose logs -f` or `docker-compose logs pump \u003Cname>`.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},573414,1792015524,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":76,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":135,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":79},1374404730887,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","DOCKER  \nCHEAT SHEET  \nFOR JAVA DEVELOPERS DOCKER  \nList all Docker Images  \ndocker images -a  \nList All Running Docker Containers  \ndocker ps  \nList All Docker Containers  \ndocker ps -a  \nStart a Docker Container  \ndocker start \u003Ccontainer name>  \nStop a Docker Container  \ndocker stop \u003Ccontainer name>  \nKill All Running Containers  \ndocker kill $ (docker ps -q)  \nView the logs of a Running Docker Container  \ndocker logs \u003Ccontainer name>  \nPAGE 1  \n SPRINGFRAMEWORK . GURU  \nDOCKER CHEAT SHEET  \nDelete All Stopped Docker Containers  \nUse -f option to nuke the running containers too.  \ndocker rm $ (docker ps -a -q)  \nRemove a Docker Image  \ndocker rmi \u003Cimage name>  \nDelete All Docker Images  \ndocker rmi $ (docker images -q)  \nDelete All Untagged (dangling) Docker Images  \ndocker rmi $ (docker images -q -f dangling=true)  \nDelete All Images  \ndocker rmi $ (docker images -q)  \nRemove Dangling Volumes  \ndocker volume rm -f $ (docker volume ls -f dangling=true -q)  \nSSH Into a Running Docker Container  \nOkay not technically SSH , but this will give you a bash shell in the container.  \nsudo docker exec -it \u003Ccontainer name> bash  \nUse Docker Compose to Build Containers  \nRun from directory of your docker-compose. yml file.  \ndocker-compose build  \nPAGE 2  \n SPRINGFRAMEWORK . GURU  \nDOCKER CHEAT SHEET  \nUse Docker Compose to Start a Group of Containers  \nUse this command from directory of your docker-compose. yml file.  \ndocker-compose up -d  \nThis will tell Docker to fetch the latest version of the container from the repo , and not use the local cache.  \ndocker-compose up -d --force-recreate  \nThis can be problematic if you ’ re doing CI builds with Jenkins and pushing Docker images to another host , or using for CI testing. I was deploying a Spring Boot Web Application from Jekins , and found the docker container was not getting refreshed with the latest Spring Boot artifact.  \n\\#stop docker containers , and rebuild docker-compose stop -t 1  \ndocker-compose rm -f  \ndocker-compose pull  \ndocker-compose build docker-compose up -d  \nFollow the Logs of Running Docker Containers With Docker Compose docker-compose logs -f  \nSave a Running Docker Container as an Image  \ndocker commit \u003Cimage name> \u003Cname for image>  \nPAGE 3  \n SPRINGFRAMEWORK . GURU  \nDOCKER CHEAT SHEET  \nFollow the logs of one container running under Docker Compose  \ndocker-compose logs pump \u003Cname>  \nAdd Oracle Java to an Image  \nFor CentOS/ RHEL  \nENV JAVA_VERSION 8u31 ENV BUILD_VERSION b13  \n\\# Upgrading system RUN yum -y upgrade RUN yum -y install wget  \n\\# Downloading & Config Java 8  \nRUN wget --no-cookies --no-check-certificate --header \" Cookie: oraclelicense=accept-securebackup-cookie \"  \n\" [http://download.oracle.com/otn-pub/java/jdk](http://download.oracle.com/otn-pub/java/jdk)[ ](http://download.oracle.com/otn-pub/java/jdk)/$JAVA_VERSION-$BUILD_VERSION/jdk-$JAVA_VERSION-linuxx64 . rpm \" -O /tmp/jdk-8-linux-x64 . rpm  \nRUN yum -y install /tmp/jdk-8-linux-x64 . rpm  \nRUN alternatives --install /usr/bin/java jar /usr/java/latest/bin/java 200000  \nRUN alternatives --install /usr/bin/javaws javaws /usr/java/latest /bin/javaws 200000  \nRUN alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 200000  \nPAGE 4  \n SPRINGFRAMEWORK . GURU  \nDOCKER CHEAT SHEET  \nAdd / Run a Spring Boot Executable Jar to a Docker Image  \nADD /maven/myapp-0 .0. 1-SNAPSHOT.jar myapp.jar RUN sh -c ' touch /myapp.jar '  \nENTRY POINT [\"java\",\"-[Djava.security.egd=file:/dev/./urandom](Djava.security.egd=file:/dev/./urandom)\",\"-jar\",\"/myapp.jar \" ]  \nShow Running Containers  \ndocker ps  \nShow All Containers - Running and stopped  \ndocker ps -a  \nDefault Tag  \n' latest ' is selected if no other value is specified  \nRun A Docker Image  \ndocker run \u003Cimage name>  \nSee the Console Output of a Docker Container  \ndocker logs \u003Ccontainer name>  \nBuild a docker image  \nFrom the directory of the Dockerfile run: docker build -t \u003Ctag name>  \nStop a docker container  \ndocker kill \u003Ccontainer name> o","cbCainWe1XTT3YJ4","https://ap.wps.com/l/cbCainWe1XTT3YJ4","pdf",230245,10,"English","# Docker Images\n## Listing and removing images\n\n# Docker Containers\n## Start/stop/kill, remove, and logs\n\n# Docker Compose\n## Build, up, pull, logs, and recreation\n\n# Building Java/Spring Boot Images\n## Add Oracle Java and run Spring Boot jars\n\n# Docker Run Parameters\n## Ports, environment variables, volumes, tags, and background mode","[{\"question\":\"How do you list Docker images and running containers?\",\"answer\":\"Use `docker images -a` to list images and `docker ps` to list running containers. Add `-a` to include stopped containers with `docker ps -a`.\"},{\"question\":\"How do you stop and remove Docker containers?\",\"answer\":\"Stop containers with `docker stop \\u003ccontainer name\\u003e` or kill them with `docker kill \\u003ccontainer name\\u003e`. Remove stopped containers using `docker rm \\u003ccontainer name\\u003e` or remove multiple containers with `docker rm $(docker ps -a -q)`.\"},{\"question\":\"What are the key Docker Compose commands shown in the sheet?\",\"answer\":\"Build containers with `docker-compose build`, start in detached mode with `docker-compose up -d`, fetch latest versions with `docker-compose pull`, and view logs with `docker-compose logs -f` or `docker-compose logs pump \\u003cname\\u003e`.\"}]","DOCKER CHEAT SHEET - FOR JAVA DEVELOPERS | PDF",1791939395]