Containers are becoming popular day by day and provide great flexibility of running the instance locally and play around for developers. For Maximo developers, it is even more relevant as there is no need to coordinate with others while enabling admin mode, or restarting the server, etc for any developmental need.
Docker for Maximo can be used by Developers to run their isolated local instance. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime system tools, system libraries, and settings.
While working with docker, the following are some of the frequently used commands which every Maximo consultant should know.
Happy Dockerizing!
Commands | Purpose |
docker --version | Version of Docker installed on your machine |
docker info | Details of Docker installed on your machine |
docker images | List of images on your machine |
docker images -a | List of images with creation time, size and all other details |
docker pull <image name> | Pull image from Docker Registry |
docker run -it -d <image name> | Run the image as docker container |
docker ps -a | List all containers and details of port, container id, image & status |
docker exec -it <Container ID> bash | Access a Running container by its Container ID |
exit | Exit from Container |
docker stop <Container ID> | Stop running container |
docker commit <Source container ID> <docker hub registry>/<name of image> | Create new image on local system from existing source image |
docker push <docker hub registry>/<name of image> | Push docker image created from local system to Docker Hub |
docker rm <container id> | Remove Container via Container ID |
docker rmi <image id> | Remove Image |
docker rmi -f <image id> | Remove Image Forcefully |
docker-compose up -d | Run container from the image |
docker exec -ti --user root <Container ID> /bin/bash | Run Docker Container as Root |
docker exec -ti --user ctginst1 <Container ID> /bin/bash | Run Docker as specific user (eg- ctginst1) |
docker container ls –aq | List IDs of all docker containers |
docker container prune | Remove all stopped containers |
docker images ls -qf dangling=tru | Remove all dangling images |
docker images prune | Remove all unused images |
docker volume ls | List all volumes |
docker volume ls -qf dangling=true | List all volumes which are Dangling |
docker volume rm $(docker volume ls -q -f dangling=true) | Remove all dangling |
docker run -it -d <image name> | Run Image as Container |
docker login | Login into Docker Hub |
docker commit <Container-ID> <RepositoryUserName>/<Repository_Name>:tag | Create image from Container |
docker push <ImageName>:<TagName> | Push image to Docker Hub |
Comments
Post a Comment