Created Ubuntu, Python, OpenCV environment on Docker

Create a Docker container based on Ubuntu and go inside

I'm mounting a volume because I want to share files locally I want to use Jupyter, so I have a port connected

docker run -it -v $(pwd):/code -p 8888:8888 --name opencv ubuntu /bin/bash

Annual event

apt-get -y update && apt-get -y upgrade

Various installations

apt-get -y install python3-pip vim
pip3 install opencv-python jupyterlab pandas matplotlib scikit-learn seaborn
apt-get -y install libgl1-mesa-dev libgtk2.0-dev 
    #If you do not include these, you will get an error with import cv2

When you want to start Jupyter

jupyter lab --ip=0.0.0.0 --allow-root --LabApp.token=''

Do this and access localhost: 8888 in your browser

Challenges point

You can't run cv2.imshow () this way, right? .. .. I will update it as soon as it is resolved.

Please let me know if you know the solution. .. ..

(Memo) This area seems to be helpful https://qiita.com/oreyutarover/items/cca3511012b6ad97a1ce https://kamino.hatenablog.com/entry/docker_gui

Postscript 2020/10/10

I wrote a separate article about the version that works with cv2.imshow () !! https://qiita.com/RyuGotoo/items/3e36622c52beb9d4e932

Recommended Posts

Created Ubuntu, Python, OpenCV environment on Docker
OpenCV3 & Python3 environment construction on Ubuntu
Build Python3 and OpenCV environment on Ubuntu 18.04
Install OpenCV on Ubuntu + python
Prepare Python development environment on Ubuntu
Building a Python environment on Ubuntu
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
Python virtual environment and packages on Ubuntu
Steps to install Python environment on Ubuntu
Create an OpenCV3 + python3 environment on OSX
Build a Python + OpenCV environment on Cloud9
build Python on Ubuntu
Install Python 3.3 on Ubuntu 12.04
Install Python 3.6 on Docker
Build python environment with pyenv on EC2 (ubuntu)
Build Python3.5 + matplotlib environment on Ubuntu 12 using Anaconda
Install python package in personal environment on Ubuntu
[Venv] Create a python virtual environment on Ubuntu
Set up Python 3.4 on Ubuntu
Use matplotlib on Ubuntu 12 & Python
# 2 Build a Python environment on AWS EC2 instance (ubuntu18.04)
[Python] OpenCV environment construction with Docker (cv2.imshow () also works)
Put Python 3.x on Ubuntu
Build python3 environment with ubuntu 16.04
I made a Python3 environment on Ubuntu with direnv.
How to build a Django (python) environment on docker
Prepare python3 environment with Docker
Build python environment on windows
Introducing TensorFlow on Ubuntu + Python 2.7
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
Install Docker on WSL Ubuntu 18.04
How to build a new python virtual environment on Ubuntu
Linux beginners create Ubuntu 16.04 environment on Docker (for Mac)-first half-
Build an Ubuntu python development environment on Google Cloud Platform
Python environment construction procedure memo using Docker on Windows10 Home
Until building a Python development environment using pyenv on Ubuntu 20.04
docker build python based on alpine
Building a Python environment on Mac
Environment construction of python and opencv
Install Python 3.8 on Ubuntu 18.04 (OS standard)
Python environment construction memo on Windows 10
Python 3.4 pyvenv fails on Ubuntu 14.04 LTS
Anaconda python environment construction on Windows 10
Install OpenCV and Chainer on Ubuntu
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Install python2.7 on windows 32bit environment
Introducing Python using pyenv on Ubuntu 20.04
Kivy + Python3 on OSX environment maintenance
Preparing python using vscode on ubuntu
Create a Python environment on Mac (2017/4)
Build Mysql + Python environment with docker
Python environment construction memo on Mac
Run TensorFlow Docker Image on Python3
Python development environment construction on macOS
Set up Python environment on CentOS
Create a python environment on centos
[Linux] Docker environment construction on Redhat
Environment construction of python3.8 on mac
code-server online environment (5) Launch code-server on Docker
Install Python 3.9 on Ubuntu 20.04 (OS standard?)
Install Python development environment on Windows 10