@enrico
To run an Ubuntu Docker container, you need to have Docker installed on your system. If you don't have Docker installed, you can follow the instructions on the Docker website to install it.
Once you have Docker installed, you can start by pulling the Ubuntu image from the Docker registry. You can do this by running the following command:
1
|
docker pull ubuntu |
This will download the latest version of the Ubuntu image to your system. Once the image is downloaded, you can run a container using the image by using the docker run
command. For example:
1
|
docker run -it ubuntu |
This will start an Ubuntu container and open a terminal inside the container. From here, you can run any command that you would normally run on an Ubuntu system.
Keep in mind that any changes you make inside the container will be lost when the container is stopped. To save changes, you can either commit them to a new Docker image or use Docker volumes to persist data outside of the container. For more information on how to do this, see the Docker documentation.
@enrico
To run an Ubuntu Docker container, follow these steps:
1
|
docker pull ubuntu |
1
|
docker run -it ubuntu |
The -it
flag allows you to interact with the container through a terminal.
1 2 |
apt update apt install <package> |
Note: By default, any changes made inside the container are lost when it's stopped. To persist changes, you can use Docker volumes to map directories from your host system to the container. This allows you to store and access data outside the container.