initial commit
This commit is contained in:
commit
3f900a2f75
9 changed files with 59 additions and 0 deletions
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
|
Loading…
Add table
Add a link
Reference in a new issue