initial commit
This commit is contained in:
commit
3f900a2f75
9 changed files with 59 additions and 0 deletions
8
02_simple_dockerfile/Dockerfile
Normal file
8
02_simple_dockerfile/Dockerfile
Normal file
|
@ -0,0 +1,8 @@
|
|||
FROM ubuntu:22.04
|
||||
|
||||
RUN apt update
|
||||
RUN apt install -yq --no-install-recommends \
|
||||
# git \
|
||||
wget \
|
||||
gcc
|
||||
COPY cool_file.txt /
|
16
02_simple_dockerfile/build_simple.sh
Executable file
16
02_simple_dockerfile/build_simple.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# build the image
|
||||
docker build -t simple:02 .
|
||||
|
||||
# see the image now exists
|
||||
docker image ls | grep simple
|
||||
|
||||
# run interactive container of image
|
||||
# -i = interactive
|
||||
# -t = allocate a pseudo tty for interactive shell
|
||||
# --rm remove the container created by this run command after it exits
|
||||
docker run -it --rm simple:02 /bin/bash
|
||||
|
||||
# alternatively, start the container, print the file, and exit/close the container
|
||||
# docker run --rm simple:02 cat /cool_file.txt
|
1
02_simple_dockerfile/cool_file.txt
Normal file
1
02_simple_dockerfile/cool_file.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Hello there!
|
Loading…
Add table
Add a link
Reference in a new issue