-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the day-to-day office work related information wiki!
Docker: To build: docker-compose -f ./docker-compose.yaml build Ex: docker-compose.exe -f docker-compose-build-module-windows.yaml build module_windows_x64_servercore Ex: docker-compose.exe -f docker-compose-build-module-linux.yaml up -d module_linux_x64_ubuntu
To push: docker-compose -f ./docker-compose.yaml push
To Start: docker-compose -f ./docker-compose.yaml up -d docker-compose.exe -f docker-compose-build-module-linux.yaml up -d module_linux_x64_ubuntu
To Stop: docker-compose -f ./docker-compose.yaml down Ex: docker-compose.exe -f docker-compose-build-module-linux.yaml down)
Moby Runtime commands
docker -H npipe:////./pipe/iotedge_moby_engine images
docker -H npipe:////./pipe/iotedge_moby_engine logs edgeAgent
docker -H npipe:////./pipe/iotedge_moby_engine ps
docker -H npipe:////./pipe/iotedge_moby_engine images
docker -H npipe:////./pipe/iotedge_moby_engine logs --since 30 --tail 60 edgeAgent
docker -H npipe:////./pipe/iotedge_moby_engine exec -it 492a650d3a72 cmd
Search images
docker images | grep iotview
DOCKER IMAGES
C:\Windows\system32>docker images
docker history edgemoduleacrcpdv.azurecr.io/edge_hmi_iotview:linux_x86_updtedgeservicesreference-210209.1
To build : docker-compose -f ./docker-compose.yaml build ( Ex: docker-compose.exe -f docker-compose-build-module-windows.yaml build module_windows_x64_servercore ) (Ex: docker-compose.exe -f docker-compose-build-module-linux.yaml up -d module_linux_x64_ubuntu ) To push : docker-compose -f ./docker-compose.yaml push
To Start -- docker-compose -f ./docker-compose.yaml up -d docker-compose.exe -f docker-compose-build-module-linux.yaml up -d module_linux_x64_ubuntu
To Stop :-- docker-compose -f ./docker-compose.yaml down ( Ex: docker-compose.exe -f docker-compose-build-module-linux.yaml down )
To build image from basic docker file instead of docker-compose.yaml file (note: docker file must be in same folder where publish conectent exsists -- for simple understand)
docker save -o edgemodulesacrcapdev.azurecr.io/enforcer:4.6.20166 "C:\Test"
docker run -v Test1:C:\edgemanagement edgemoduleacrdv.azurecr.io/edge_module_sdk_module:windows_x64_nanoserver_0.0.0.34-secrets
docker build -t vishwamodule:v5 .do
docker build -t : .
docker rmi -f docker rmi -f $(docker images -q -a) ====> To Bulk Delete
docker rm -f $(docker ps -q -a) // removing all of them at once
To go inside Container:
docker run -it <image name>
docker exec -it edge_module_sdk_module /bin/bash
docker exec -it build_module_linux_x64_ubuntu_1 /bin/bash
docker run -it --rm --entrypoint sh 699
***************************************************************************************
- Registry server: iotedge.azurecr.io
- Registry user: iotedge
- Registry password: PZuX+njmm3BRBAX+FubJk9NiWjUdC4wg
***********************************************************
Removing Docker FROM Edge machine
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
https://askubuntu.com/questions/935569/how-to-completely-uninstall-docker
docker -H npipe:////./pipe/iotedge_moby_engine run --rm -it -v D:/FullRuntimeV2/Patch:C:/Patch -p 8000:8000 -p 10001:80 -p 10002:1234 -p 10003:51234 iotedge.azurecr.io/edge_hmi_fullruntime:windows_0.0.1-alpha-0011 cmd
docker -H npipe:////./pipe/iotedge_moby_engine run -p 8001:8000
docker -H npipe:////./pipe/iotedge_moby_engine run --rm -it -v D:/FullRuntimeV2/Patch:C:/Patch -p 8000:8000 -p 10001:80 -p 10002:1234 -p 10003:51234 iotedge.azurecr.io/edge_hmi_fullruntime:windows_0.0.1-alpha-0011 cmd
docker -H npipe:////./pipe/iotedge_moby_engine exec -it 301352f0a254 cmd
**********************************************************************************
sudo docker rm -f $(docker ps -q -a)
sudo apt-get purge -y docker-ce-cli
sudo apt-get autoremove -y --purge docker-ce-clisudo rm -rf /var/lib/docker /etc/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock
sudo printenv http_proxy
sudo -E printenv http_proxy
*************************************************************************************
Stop all containers: docker -H npipe:////./pipe/iotedge_moby_engine stop $(docker -H npipe:////./pipe/iotedge_moby_engine ps -a -q)
Start all containers: docker -H npipe:////./pipe/iotedge_moby_engine start $(docker -H npipe:////./pipe/iotedge_moby_engine ps -a -q)
******************************************************************************************************
Copy Private binaries:
docker -H npipe:////./pipe/iotedge_moby_engine cp C:\Users\wwuser\Desktop\Iot\edge.ww_intouch.dll WWInTouch:/"C:\InTouch\edge.ww_intouch.dll"
docker -H npipe:////./pipe/iotedge_moby_engine cp c03c25c5d771:C:\workspace\historian_encryption_console_driver\ ./vishwa
docker -H npipe:////./pipe/iotedge_moby_engine cp C:\Users\wwuser\Desktop\Iot\edge.ww_intouch.exe WWInTouch:/"C:\InTouch\edge.ww_intouch.exe"
docker cp dummy:/root/payload.json C:\vidte... by Vidyasagar Barigeda
docker cp dummy:/root/payload.json C:\vidtest\fromcontainer.json
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
http://rogeriodossantos.github.io/Wiki/stage/docker_commands.html
Moby Runtime commands
**********************
docker -H npipe:////./pipe/iotedge_moby_engine images
docker -H npipe:////./pipe/iotedge_moby_engine logs edgeAgent
docker -H npipe:////./pipe/iotedge_moby_engine ps
docker -H npipe:////./pipe/iotedge_moby_engine images
docker -H npipe:////./pipe/iotedge_moby_engine logs --since 30 --tail 60 edgeAgent
docker -H npipe:////./pipe/iotedge_moby_engine exec -it 492a650d3a72 cmd
Search images
~~~~~~~~~~~~~
docker images | grep iotview
DOCKER IMAGES
~~~~~~~~~~~~~~
C:\Windows\system32>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
vishwa/iotviewmodule v0.4-amd64 ac24a5a8f057 4 weeks ago 367MB
iotedge.azurecr.io/iotviewmodule v0.4-amd64 ac24a5a8f057 4 weeks ago 367MB
rogersantos/iotviewmodule dev-amd64 ac24a5a8f057 4 weeks ago 367MB
rogersantos/iotviewmodule v0.3-amd64 ac24a5a8f057 4 weeks ago 367MB
DOCKER TAG
~~~~~~~~~~~
C:\Windows\system32>docker tag iotedge.azure.io/iotviewmodule:v0.4-amd64 iotedge.azurecr.io/iotviewmodule:v0.5-amd64
DOCKER PUSH
~~~~~~~~~~~~
C:\Windows\system32>docker push iotedge.azurecr.io/iotviewmodule:v0.5-amd64
The push refers to repository [iotedge.azurecr.io/iotviewmodule]
629aa52dc330: Layer already exists
0ce2e26784a1: Layer already exists
a631c7bc6a51: Layer already exists
d9908cb94ecb: Layer already exists
7310fef10f59: Layer already exists
62a816fb672d: Layer already exists
1e2e404a7fef: Layer already exists
b2ee08631147: Layer already exists
c995dd0ee8c7: Layer already exists
1dd6a543ac2e: Layer already exists
0f183608893b: Layer already exists
2097bc238c16: Layer already exists
43fcb4d503eb: Layer already exists
46b69f358fee: Layer already exists
b116468880ac: Layer already exists
57bda236ae67: Layer already exists
ef68f6734aa4: Layer already exists
v0.5-amd64: digest: sha256:85785cc7d41b65f943548a5aa26b79f2624f1e29912e33dffdea52b7c83ed409 size: 3892
DOCKER INSPECT
~~~~~~~~~~~~~~
C:\Users\vishwanath.reddy>docker inspect iotedge.azurecr.io/iotviewmodule:v0.4-amd64
DOCKER PULL
~~~~~~~~~~~
docker pull iotedge.azurecr.io/edge_agent:linux_dev
C:\WINDOWS\system32>docker pull microsoft/dotnet-framework:4.7.2-runtime
4.7.2-runtime: Pulling from microsoft/dotnet-framework
65014b3c3121: Pull complete
0e787b79aad1: Pull complete
3f1c2572e598: Pull complete
Digest: sha256:95d3d5fbf28c8949c76612b72d7d2d2b65bde64ae070d40da330ec7550fd7eae
Status: Downloaded newer image for microsoft/dotnet-framework:4.7.2-runtime
DOCKER LOAD
~~~~~~~~~~~~
E:\Docker Test>docker load -i publisherimage.tar
1fb92aaaa245: Loading layer [==================================================>] 54.27kB/54.27kB
8751598128ee: Loading layer [==================================================>] 541.6MB/541.6MB
Loaded image: build/publisher:v2
DOCKER RUN
~~~~~~~~~~~~
E:\Docker Test>docker run -it 4a0c7a93044a cmd
Microsoft Windows [Version 10.0.17763.437]
(c) 2018 Microsoft Corporation. All rights reserved.
docker run -d -p 8000:80 <image_name>
docker run -d -p 8000:80 a4eb650076c9
C:\Users\vishwanath.reddy>docker run -it -d -p 80:8000 a4eb650076c9
6938c5d0071ed54f5aa6fc066a76c71d55041e30201f859bfd9a0c05fdc866d1
docker: Error response from daemon: driver failed programming external connectivity on endpoint peaceful_merkle (16cf650b8efe8a16dfb95b1c8cfb41a1a9a4efee8585b0557d4e9f34790a7767): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:80:tcp:172.17.0.4:8000: input/output error.
DOCKER ATTACH
~~~~~~~~~~~~~~
docker attach intouch_module_iotview_demo_1_55fc83400954
DOCKER LOGIN
~~~~~~~~~~~~~
docker login --username iotedge --password <password> iotedge.azurecr.io
DOCKER BUILD
~~~~~~~~~~~~
docker-compose -f ./docker-compose-module-metadata-examples-vishwatest.yaml build
******************************************************************************************************
Creating Basic Docker image (Windows or Linux).
Note: Docker file with below data should be in the folder. also executabl with name "VishwaDockerTest.exe" also should be there then issue below command.
# GETTING BASE IMAGE ubuntu
#FROM ubuntu:latest
FROM microsoft/dotnet-framework:4.7.2-runtime
ADD VishwaDockerTest.exe /
-----------------------------------------------------
D:\IoTEdge\Dockers\DockerFiles>docker build "D:\IoTEdge\Dockers\DockerFiles"
Sending build context to Docker daemon 7.168kB
Step 1/2 : FROM microsoft/dotnet-framework:4.7.2-runtime
4.7.2-runtime: Pulling from microsoft/dotnet-framework
65014b3c3121: Pull complete
02a4c14ecf32: Pull complete
8c17b38b0119: Pull complete
7293b3dfa9d5: Pull complete
Digest: sha256:0c5ea513dd39247c94f7a22b24c0df47963a3d7fdc7b27de0b1a4e60aab64624
Status: Downloaded newer image for microsoft/dotnet-framework:4.7.2-runtime
---> 41a6f7773fff
Step 2/2 : ADD VishwaDockerTest.exe /
---> 9ba2ca2f4728
Successfully built 9ba2ca2f4728
Before you push the image into some container registry you must tag the image with some name.
docker tag 9ba2ca2f4728 9ba2ca2f4728:v0.1
docker tag 9ba2ca2f4728 iotedge.azurecr.io/9ba2ca2f4728:v0.2
docker push iotedge.azurecr.io/9ba2ca2f4728:v0.2
dokcer pull iotedge.azurecr.io/9ba2ca2f4728:v0.2