Sign inSign up

andy30sh/ubuntu

By andy30sh

Updated 10 months ago

Ubuntu Linux built with software development packages including C/C++, JAVA, PYTHON, JavaScript.

Image
Languages & frameworks
Developer tools
Databases & storage
1

10K+

andy30sh/ubuntu repository overview

Ubuntu v18.04, v20.04, v22.10, v23.10

Description

  • Remote access via sshd enabled & allow root login
  • Public key authentication enabled
  • Editors - vim, nano
  • Network tools - net-tools, wget, curl
  • Version controls - Git, Subversion
  • Programming languages - C/C++, Java, Python, JavaScript(Node.js)
  • Default linked volumes (/shared, /storage)

Instruction

Create Ubuntu docker container

1. Pull Image

docker pull andy30sh/ubuntu:[tagName]

e.g. docker pull andy30sh/ubuntu:20.04

2. Create Container

docker run -d -it --name [ContainerName] -p 22:22 --hostname [ContainerHostname] andy30sh/ubuntu:[tagName]

e.g. docker run -d -it --name Ubuntu20.04 -p 22:22 --hostname ubuntu20.private andy30sh/ubuntu:20.04
For volume mount use: -v [HostPath]:/shared -v [HostPath]:/storage

3. Change root password

docker exec -it [ContainerName] bash
echo 'root:[yourPassword]' | chpasswd
exit

e.g. docker exec -it Ubuntu20.04 bash

echo 'root:P@ssw0rd' | chpasswd

Operate Ubuntu docker container

1. Start Container

docker start [ContainerName]

e.g. docker start Ubuntu20.04

2. Stop Container

docker stop [ContainerName]

e.g. docker stop Ubuntu20.04

3. Container status

docker ps -a

4. Container resource

docker stats [ContainerName]

e.g. docker stats Ubuntu20.04

Connect to Ubuntu docker container

1. Connect Container by terminal

docker exec -it [ContainerName] bash

e.g. docker exec -it Ubuntu20.04 bash

2. Connect Container by ssh client

ssh root@[HostAddress]

e.g. ssh root@localhost, ssh [email protected]

3. Connect Container by PuTTY

* Download private key from /root/.ssh/vm.ppk
* Download PuTTY from this [link](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
* Install PuTTY     
* Open PuTTY enter fields  
** Host Name: root@[HostName|HostIP] e.g. [email protected]  
** Port: 22  
** Connection type: SSH  
** Saved Sessions: [yourSessionName]  
** Category -> Connection -> SSH -> Auth -> Private key file for authentication  
*** Select the 'vm.ppk' private key file downloaded from Container  
* Open (connect to Container without password prompt)  
Remove Ubuntu docker container

1. Remove Container

# show container IDs
docker ps -a
# remove container via ID
docker rm -f [ContainerID]

2. Remove Image

# show image IDs
docker images
# remove image via ID
docker rmi -f [ImageID]

Tag summary

Content type

Image

Digest

sha256:e864befaf

Size

580.4 MB

Last updated

10 months ago

docker pull andy30sh/ubuntu