My first docker file
root@kirkkubernetes docker]# cat dockerfile
# Welcome Mr.Spock. Please write me a docker file ;-)
FROM debian:latest
RUN echo "hello debian"
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install mc -y
[root@kirkkubernetes docker]#
How to run containers?
1. show images:
[root@kirkkubernetes docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
dockerfile latest 0fc75d17a29b 5 minutes ago 290MB
debian latest 3676c78a12ad 3 weeks ago 116MB
hello-world latest 9c7a54a9a43c 2 months ago 13.3kB
2. use docker run:
docker run [options (for example -it)] IMAGE ID
[root@kirkkubernetes docker]# docker run -it 0fc75d17a29b
root@9f608cd63e66:/# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@9f608cd63e66:/#
Žiadne komentáre:
Zverejnenie komentára