When using cv2 in Dockerfile.
Adding library below to your Dockerfile to solve the issue :
RUN apt-get update
RUN apt-get install ffmpeg libsm6 libxext6 -y| echo "Press 'q' to continue" | |
| count=0 | |
| while : ; do | |
| read -n 1 k <&1 | |
| if [[ $k = q ]] ; then | |
| break | |
| fi | |
| done |
| mkdir coco | |
| cd coco | |
| mkdir images | |
| cd images | |
| wget http://images.cocodataset.org/zips/train2017.zip | |
| wget http://images.cocodataset.org/zips/val2017.zip | |
| wget http://images.cocodataset.org/zips/test2017.zip | |
| wget http://images.cocodataset.org/zips/unlabeled2017.zip |
| Function GetServiceByName { | |
| Param ( | |
| [string]$ServiceName | |
| ) | |
| return Get-WmiObject -Class Win32_Service -Filter "Name LIKE '$ServiceName'" | Select-Object -ExpandProperty ProcessId | |
| } | |
| $nid = GetServiceByName -ServiceName "notepad" | |
| If ($nid -ne 0) { |
Example : I would like to terminate node and filebeat service after test service run finished or exit code is zero (success).
We need to create shell script and adding two docker-compose up's options,
it's --abort-on-container-exit and --exit-code-from (the shell script below related with docker-container.yml)
shell-scrip.sh
( (docker-compose -f docker-compose.yml down -v) || : ) && \| VERSION=2.1.1 | |
| rm -rf ~/docker-compose | |
| sudo curl -L "https://github.com/docker/compose/releases/download/$VERSION/docker-compose-$(uname -s)-$(uname -m)" -o ~/docker-compose | |
| sudo chmod +x ~/docker-compose | |
| sudo mv ~/docker-compose /usr/local/bin/docker-compose | |
| docker-compose -v |