Docker

koby8855

 

  1. Download and install Docker
  2. Start the Docker Quickstart Terminal (Docker Toolbox) or Powershell (Docker Desktop)
  3. Change to a directory you can write to (the Quickstart Terminal starts you in /c/Program Files/Docker Toolbox) and clone the IT635 repo (Links to an external site.)

rxt1077@R90VJ3MK MINGW64 /c/Program Files/Docker Toolbox 

$ cd  

rxt1077@R90VJ3MK MINGW64 ~ 

$ git clone https://github.com/rxt1077/IT635.git 

 Cloning into 'IT635'... 

remote: Enumerating objects: 7, done. 

remote: Counting objects: 100% (7/7), done. 

remote: Compressing objects: 100% (5/5), done. 

remote: Total 46 (delta 2), reused 6 (delta 2), pack-reused 39 

Unpacking objects: 100% (46/46), done. 


4. Change into the Exercise 1 directory:$ cd IT635/Exercise\ 1 


5. Build the Docker image and tag it as "exercise1":

rxt1077@R90VJ3MK MINGW64 ~/IT635/Exercise 1 (master) 

$ docker build -t exercise1 . 

Sending build context to Docker daemon  10.75kB 

Step 1/3 : FROM alpine 

 ---> e7d92cdc71fe 

Step 2/3 : COPY passwords.db /  

---> Using cache  ---> 52b15776c0ad 

Step 3/3 : RUN apk update  && apk add sqlite 

 ---> Using cache  

---> b365b0697a5e 

Successfully built b365b0697a5e 

Successfully tagged exercise1:latest 

SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories. 


6.Run the image and start an interactive terminal:rxt1077@R90VJ3MK MINGW64 ~/IT635/Exercise 1 (master) $ docker run -it exercise1 sh / #    

7. You are now inside a Linux container running on Docker on your laptop. Notice how the prompt changes to "/ #"

8. Start sqlite3 to look at the password database in the root directory:/ # sqlite3 passwords.db SQLite version 3.30.1 2019-10-10 20:19:45 Enter ".help" for usage hints. sqlite> 

9.You are now in sqlite, running inside a shell, inside a container, on Docker, on your laptop. From here on I won't show you the output, it's up to you

10. Run ".tables". This will show you what tables are in the database

11. Run ".schema <table name>" where <table name> is the only table in the database. This will show you how it is set up

12. Run "select * from <table name>;" and figure out what YOUR password is (should be a color and an animal)

13.Submit that password as your response in the textbox of this assignment.

I need the password. 

    • 6 years ago
    • 8
    Answer(0)