GithubHelp home page GithubHelp logo

parkito / learndocker Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 6.26 MB

Docker basics

Kotlin 48.92% Java 48.35% Python 0.21% Dockerfile 2.52%
docker virtualization docker-compose kubernetes java kotlin t-systems

learndocker's Introduction

Repository for docker lecture in T-Systems java school

Lecture and practice exercises give overview of docker tech stack

Docker basic

Oerview of docker architecture and basics

Docker file system and networking

Oerview UFS and networking interface

Docker image building

Creating docker images

Tasks

Before you start

Perform this steps. It'll save time during practice

1) Clone repository on your PC

 git clone https://github.com/parkito/LearnDocker

2) Pull next images on your PC

 docker pull parkito/hellodocker
 docker pull parkito/layer-server
 docker pull parkito/layer-client

Commands for hello docker chapter

docker run docker/whalesay                 // run container from Image. If there is not image on local PC it will be downloaded 

docker run -it ubuntu bash                 // run container in interactive mode (using bash-sehll)

ls /var                                    // using bash-shell of ubuntu container

docker attach ContainerID                  // attache to interactive mode of running container

docker run -d ubuntu apt update            // run container in detach mode

docker ps                                  // observe running containers

docker ps -a                               // observe all containers

docker images                              // observe all local images

docker rm ContainerID                      // delete container

docker rmi ubuntu                          // delete image

Commands for docker layers and networking chapter

docker network create myntw                // create new network

docker run -it -p 2141:2141 --name u1  parkito/ubuntu-with-ping bash  // run container with u1 name with exposed 2141 port 
docker run -it -p 2142:2142 --name u2  parkito/ubuntu-with-ping bash

docker run -it -p 2141:2141 --name u1 --link u2  parkito/ubuntu-with-ping bash    // run container and link it to another
docker run -it -p 2142:2142 --name u2  parkito/ubuntu-with-ping bash

docker run -it -p 2141:2141 --name u1 --net=myntw parkito/ubuntu-with-ping bash   // run container with myntw network
docker run -it -p 2142:2142 --name u2 --net=myntw parkito/ubuntu-with-ping bash

docker run -it -v C:\Users\akarnov\Downloads\:/my -p 2142:2142 ubuntu bash    // run container with mounted volume 

                         //image inspections

docker history ubuntu     
docker inspect ubuntu

docker diff ContainerId
docker inspect ContainerId

Commands for dockerfile chapter

mvn clean package docker:build     //using docker maven plugin


// Dockerfile example

FROM openjdk:8-jre-alpine
RUN mkdir /var/lib/user-service
COPY /target/user-1.0.jar /var/lib/user-service
WORKDIR /var/lib/user-service
EXPOSE 2144
CMD ["java", "-jar", "user-1.0.jar"] 

learndocker's People

Contributors

parkito avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.