0% found this document useful (0 votes)
25 views1 page

Lab02. Installation in A Container

This document provides a step-by-step guide for installing and running Docker containers on Windows, including checking the Docker version and running a Hello World sample. It also details how to start a local MongoDB instance within a Docker container and connect to it using Mongo Shell. The next steps involve importing sample data into the MongoDB instance using mongoimport.

Uploaded by

Cristina Siscanu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Lab02. Installation in A Container

This document provides a step-by-step guide for installing and running Docker containers on Windows, including checking the Docker version and running a Hello World sample. It also details how to start a local MongoDB instance within a Docker container and connect to it using Mongo Shell. The next steps involve importing sample data into the MongoDB instance using mongoimport.

Uploaded by

Cristina Siscanu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

*** Installation in a Container ***

1. Install Docker
https://docs.docker.com/docker-for-windows/install/

2. Open Windows Terminal and check Docker version


> docker version

3. Run the Hello World sample


docker run hello-world
- You shoud see a hello message at the command prompt.

4. See the running containers


> docker ps -a

You should see the Hello World running.

5. List all images currently downloaded in the system


> docker image ls

6. See the log of the container


> docker ps -a <- Note down the container ID
> docker logs <container_id>

7. List all running containers


> docker container ls

8. Start a local MongoDB instance running inside a Docker container


> docker run -d --name mongo-on-docker -p 27888:27017 -e
MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=secret mongo

9. Connect to the local MongoDB instance using Mongo Shell


> mongosh mongodb://mongoadmin:secret@localhost:27888/?authSource=admin

NEXT:
We will import some sample data into the MongoDB instance. Familiarize yourself
with MongoDB Database Tools, particularly mongoimport.

You might also like