>docker pull nginx
>mkdir F:\nginx
* 해당 폴더 안에 디폴트 페이지 생성
ex)
#vi index.html
wow Hello Docker
출처: https://minimilab.tistory.com/8 [MINIMI LAB]
>docker run --name nginx_sec -v F:\nginx:/usr/share/nginx/html:ro -d -p 80:80 nginx
* 위 명령어 수행 시 ':' 콜론 문자 때문에 에러가 나므로 F:\ 경로로 들어가서 콜론을 사용하지 않도록 한 상태에서 연결할 디렉터리를 지정
F:\>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
566cc08b146b nginx "/docker-entrypoint.…" About a minute ago Up About a minute 0.0.0.0:80->80/tcp nginx_sec
F:\>docker exec -it 56 bash
root@566cc08b146b:/#
apt update
apt upgrade
apt-get update
apt-get install software-properties-common vim net-tools gpg iputils-ping -y
apt-get update && apt-get install procps -y
* procps : ps 명령어 설치
>docker commit nginx:latest
---------------------------------
* python 3.9 설치
# add-apt-repository ppa:deadsnakes/ppa
# apt update
# apt install wget software-properties-common
# apt install python3.9
4.) (NOT Recommended) To use Python 3.9 as the default python3, run commands:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2
* ppa 관련 에러가 나타날 경우 해당 ppa 제거
sudo add-apt-repository --remove ppa:webupd8team/ppa
sudo apt update
For Ubuntu 16.04 and Ubuntu 18.04, replace python3.8 in the code with system’s default python3 version..
And you can then switch between the two Python3 versions via command:
sudo update-alternatives --config python3
NOTE: Due to known bug, terminal won’t open if you changed python3 symlink. An workaround is recreate a symlink via command (Replace python 3.8 with your system default python3 version):sudo rm /usr/bin/python3; sudo ln -s python3.8 /usr/bin/python3Uninstall:
To uninstall the Python3.9 packages, run command:
sudo apt remove --autoremove python3.9 python3.9-minimal
ubuntuhandbook.org/index.php/2020/10/python-3-9-0-released-install-ppa-ubuntu/
Installing Python 3.9 Using Source Code
You also have one more option option to install Python 3.9 using source code. We don’t recommend to install Python 3.9 packages from source code. But in some cases you may need to install Python from source code.
So follow the below instructions to install Python 3.9 using source code on Ubuntu 20.04 Linux system.
- First of all, install essential packages for compiling source code. Open a terminal and execute following commands:
- sudo apt install build-essential checkinstall
- sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev \ libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
- Now, download the Python 3.9 source code from official download site. Switch to a relevant directory and use wget to download source file.
- cd /opt
- sudo wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
- Next, extract the downloaded archive file and prepare the source for the installation.
- tar xzf Python-3.9.0.tgz
- cd Python-3.9.0
- sudo ./configure --enable-optimizations
- Python source is ready to install. Execute make altinstall command to install Python 3.9 on your system.
- sudo make altinstall
make altinstall is used to prevent replacing the default python binary file /usr/bin/python.
- The Python 3.9 has been installed on Ubuntu 18.04 system. Verify the installed version:
- python3.9 -V
- Python 3.9.0
- Remove the downloaded archive to free space
- sudo rm -f /opt/Python-3.9.0.tgz
Conclusion
In this tutorial, you have learned to install Python 3.9 on Ubuntu 20.04 using Apt and source code. You can try Python examples via command line.
* pip 설치 (파이썬 설치 후)
# apt-get install python-pip
* docker-compose 설치
# pip install docker-compose
'Docker' 카테고리의 다른 글
debian docker에 jdk 설치하기 (0) | 2020.12.02 |
---|---|
[에러메세지] The repository 'https://download.docker.com/linux/ubuntu buster Release' does not have a Release file (0) | 2020.12.02 |
docker command 정리 (0) | 2020.09.07 |
Kali linux에 docker 설치하기 (0) | 2020.09.07 |
Docker Kali Linux Install(윈도우에 kali linux docker 설치) (0) | 2020.09.07 |