initial commit
This commit is contained in:
commit
3f900a2f75
5
01_registry_pull/pull.sh
Executable file
5
01_registry_pull/pull.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
docker pull ubuntu:23.04
|
||||
|
||||
docker image ls | grep ubuntu
|
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!
|
17
03_dockerfile_with_args/Dockerfile
Normal file
17
03_dockerfile_with_args/Dockerfile
Normal file
|
@ -0,0 +1,17 @@
|
|||
FROM ubuntu:22.04
|
||||
|
||||
RUN apt update \
|
||||
&& apt install -yq --no-install-recommends \
|
||||
wget \
|
||||
tar \
|
||||
xz-utils \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/list
|
||||
|
||||
ARG CMAKE_VERSION=3.16.5
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh \
|
||||
-q --no-verbose --show-progress --progress=bar:force:noscroll -O /tmp/cmake-install.sh \
|
||||
&& chmod u+x /tmp/cmake-install.sh \
|
||||
&& mkdir /usr/bin/cmake \
|
||||
&& /tmp/cmake-install.sh --skip-license --prefix=/usr/ \
|
||||
&& rm /tmp/cmake-install.sh
|
9
03_dockerfile_with_args/build_with_args.sh
Normal file
9
03_dockerfile_with_args/build_with_args.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# build with CMake version specified in dockerfile
|
||||
docker build -t with_args:default .
|
||||
docker run --rm with_args:default cmake --version
|
||||
|
||||
# build with specific CMake version
|
||||
docker build --build-arg CMAKE_VERSION=3.26.5 -t with_args:3.26 .
|
||||
docker run --rm with_args:3.26 cmake --version
|
0
04_multistage_docker_file/multistage_build.sh
Normal file
0
04_multistage_docker_file/multistage_build.sh
Normal file
0
05_complex_run_with_compose/complex_with_compose.sh
Normal file
0
05_complex_run_with_compose/complex_with_compose.sh
Normal file
Loading…
Reference in a new issue