Giter Club home page Giter Club logo

docker-demo's Introduction

How to install docker in Ubuntu?

  1. https://docs.docker.com/engine/install/ubuntu/

Getting Started with coreSUP-Docker

  1. Copy the following script to setup_docker.sh file and place it to project root directory. Edit Line 4, 8 & 12 of setup_docker.sh occording to your product folder location
#!/bin/bash
# COPY USERAPP TO PROJECT ROOT DIRECTORY OR USER THE RIGHT PATH TO DOCKERFILE
# cp -r /home/sandvik/workspace/core-carrier-dh/product/deploy/mcc_linux_debug/inst_mcc_CM/sandvik ./sandvik
cp -r path/product/deploy/mcc_linux_debug/inst_mcc_CM/sandvik ./sandvik

# COPY SANDVIK TO PROJECT ROOT OR USE THE RIGHT PATH TO DOCKERFILE
# cp -r /home/sandvik/workspace/core-carrier-dh/product/deploy/core_linux_debug/inst/ ./userapp
cp -r path/product/deploy/core_linux_debug/inst/ ./userapp

# Change the production base URL to localhost
# sed -i s/192.168.20.15:8000/127.0.0.1:8001/g /home/sandvik/workspace/DOCKER/mcc-coresup/userapp/maintenance/cfg/httpservice/webpage/configs/applicationConfig.json
sed -i s/192.168.20.15:8000/127.0.0.1:8001/g project_root_path/userapp/maintenance/cfg/httpservice/webpage/configs/applicationConfig.json

# Uncomment NO_BUS from mcon.cfg of uesrapp
sed -i 's/#NO_BUS/NO_BUS/g' userapp/maintenance/cfg/mcon/mcon.cfg
  1. Create a Dockerfile in project root and paste the following code inside
FROM 138.103.127.156:8081/docker-local/core-runtime/core-runtime-x86:2.24

WORKDIR /

COPY sandvik /opt/sandvik

COPY userapp /opt/userapp

CMD bash -c "/opt/sandvik/start.sh && /opt/userapp/core_runtime_starter.sh"
  1. Create a run.sh in project root and paste the following code inside
#!/bin/sh

# Run the project_setup scripts
bash workspace/core-carrier-dh/product/scripts/project/setup_docker.sh

# How to build it?
docker build -t coresup-docker-image .

# How to run it?
docker run -ti --name coresup-docker-container -p 21099:21098 -p 8001:8000 coresup-docker-image
  1. Open browser inside sica dev-end and navigate 127.0.0.1:8001
  2. Open Diagtool and Set Remote Config with 127.0.0.1:21099
  3. TAAAA-DAAAA!!! You are good to try signal manipulations and the app is up and running with docker.

Some Basic Docker command

  1. List all the docker images
docker images
  1. Delete docker image
docker rmi <IMAGE_NAME or IMAGE_ID>
  1. List all the docker container
docker ps -a
  1. Delete docker container
docker rm <CONTAINER_NAME or CONTAINER_ID>
  1. Build a docker image
docker build -t <image_name_you_want_to_give> . (. means build the image in current directory)
  1. Run a docker container with image
docker run -it -rm -p 4678(hostport):45678(container_port) --name <container_name_you_want_to_give> <image_name or Image_id>
# check the official docker documentation to have better idea about more flags: https://docs.docker.com/engine/reference/commandline/build/
  1. Build a docker image from docker container
docker commit <CONTAINER_NAME> <image-name_you_want_to_give>
  1. To open a new terminal indide docker container
docker exec -it <CONATINER_NAME> bash
  1. Move to attach move if a container running in detach move
docker attach <CONTAINER_NAME>
  1. Check the docker daemon status, stop, start, restart
sudo systemctl status docker
sudo systemctl start docker
sudo systemctl stop docker
sudo systemctl restart docker

Some Nice Resources if you want to check more about Docker (of course official docker documentation's are the BEST)

  1. https://docs.docker.com/get-started/
  2. https://docs.docker.com/engine/reference/run/
  3. https://www.bogotobogo.com/DevOps/Docker/Docker-Cheat-Sheet.php
  4. https://www.youtube.com/watch?v=fqMOX6JJhGo
  5. https://github.com/wsargent/docker-cheat-sheet

docker-demo's People

Contributors

tasmiarahmantanjin 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.