Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:docker3:en:dre02 [2023/12/17 05:24] – created admin | elearning:workbooks:docker3:en:dre02 [2024/12/17 13:46] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version: **2023.01** | + | Version: **2024.01** |
Last update: ~~LASTMOD~~ | Last update: ~~LASTMOD~~ | ||
Ligne 54: | Ligne 54: | ||
RUN set -eux; \ | RUN set -eux; \ | ||
apt-get update; \ | apt-get update; \ | ||
- | apt-get install -y --no-install-recommends | + | apt-get install -y --no-install-recommends |
- | ca-certificates | + | ca-certificates |
- | jq | + | jq \ |
- | numactl | + | numactl |
; \ | ; \ | ||
if ! command -v ps > /dev/null; then \ | if ! command -v ps > /dev/null; then \ | ||
Ligne 72: | Ligne 72: | ||
\ | \ | ||
apt-get update; \ | apt-get update; \ | ||
- | apt-get install -y --no-install-recommends | + | apt-get install -y --no-install-recommends |
- | wget | + | wget \ |
; \ | ; \ | ||
if ! command -v gpg > /dev/null; then \ | if ! command -v gpg > /dev/null; then \ | ||
Ligne 81: | Ligne 81: | ||
\ | \ | ||
dpkgArch=" | dpkgArch=" | ||
- | wget -O / | + | wget -O / |
wget -O / | wget -O / | ||
export GNUPGHOME=" | export GNUPGHOME=" | ||
Ligne 123: | Ligne 123: | ||
RUN echo "deb http:// | RUN echo "deb http:// | ||
- | RUN set -x | + | RUN set -x \ |
&& apt-get update \ | && apt-get update \ | ||
&& apt-get install -y \ | && apt-get install -y \ | ||
${MONGO_PACKAGE}=$MONGO_VERSION \ | ${MONGO_PACKAGE}=$MONGO_VERSION \ | ||
${MONGO_PACKAGE}-server=$MONGO_VERSION \ | ${MONGO_PACKAGE}-server=$MONGO_VERSION \ | ||
- | ${MONGO_PACKAGE}-shell=$MONGO_VERSION \y | + | ${MONGO_PACKAGE}-shell=$MONGO_VERSION \ |
${MONGO_PACKAGE}-mongos=$MONGO_VERSION \ | ${MONGO_PACKAGE}-mongos=$MONGO_VERSION \ | ||
${MONGO_PACKAGE}-tools=$MONGO_VERSION \ | ${MONGO_PACKAGE}-tools=$MONGO_VERSION \ | ||
Ligne 142: | Ligne 142: | ||
ENTRYPOINT [" | ENTRYPOINT [" | ||
- | EXHIBIT | + | EXPOSE |
CMD [" | CMD [" | ||
</ | </ | ||
Ligne 164: | Ligne 164: | ||
if [[ " | if [[ " | ||
if [ " | if [ " | ||
- | find / | + | find / |
fi | fi | ||
Ligne 185: | Ligne 185: | ||
# usage: file_env VAR [DEFAULT] | # usage: file_env VAR [DEFAULT] | ||
- | # ie: file_env ' | + | # ie: file_env ' |
# (will allow for " | # (will allow for " | ||
- | # " | + | # " |
file_env() { | file_env() { | ||
local var=" | local var=" | ||
Ligne 291: | Ligne 291: | ||
# _js_escape 'some " | # _js_escape 'some " | ||
_js_escape() { | _js_escape() { | ||
- | jq --null-input --arg ' | + | jq --null-input --arg ' |
} | } | ||
Ligne 305: | Ligne 305: | ||
# if --config is specified, parse it into a JSON file so we can remove a few problematic keys (especially SSL-related keys) | # if --config is specified, parse it into a JSON file so we can remove a few problematic keys (especially SSL-related keys) | ||
# see https:// | # see https:// | ||
- | mongo --norc --nodb --quiet --eval " | + | mongo --norc --nodb --quiet --eval " |
jq ' | jq ' | ||
return 0 | return 0 | ||
Ligne 470: | Ligne 470: | ||
*.sh) echo "$0: running $f"; . " | *.sh) echo "$0: running $f"; . " | ||
*.js) echo "$0: running $f"; " | *.js) echo "$0: running $f"; " | ||
- | *) echo "$0: ignoring $f" ;; | + | *) echo "$0: ignoring $f" ;; |
esac | esac | ||
echo | echo | ||
Ligne 950: | Ligne 950: | ||
=====LAB #2 - Creating a Dockerfile===== | =====LAB #2 - Creating a Dockerfile===== | ||
- | ====2.1 - Creating and testing the==== | + | ====2.1 - Creating and testing the script |
Create a directory named myDocker: | Create a directory named myDocker: | ||
Ligne 1103: | Ligne 1103: | ||
< | < | ||
- | root@debian11: | + | root@debian11: |
myDocker | myDocker | ||
root@debian11: | root@debian11: | ||
CONTAINER ID | CONTAINER ID | ||
- | 97fe360bb1d6 | + | 97fe360bb1d6 |
880733c6bdc3 | 880733c6bdc3 | ||
885f75b6aa57 | 885f75b6aa57 | ||
Ligne 1601: | Ligne 1601: | ||
----- | ----- | ||
- | Copyright © 2023 Hugh Norris. | + | Copyright © 2024 Hugh Norris. |