GitLab CI command not found when using docker - docker

I feel like I have tried everything, and don't understand why commands can't be found in my GitLab CI script.
Here is my script
stages:
- build
build:
image: ubuntu:20.04
stage: build
only:
- master
tags:
- docker
script:
- adduser --disabled-password --gecos "" meteor_install
- apt update -y
- apt install curl -y
- su meteor_install
- echo $0
- cd ~
- ls -alh
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
- ls -alh
- source ~/.bashrc
- cat ~/.bashrc
- export NVM_DIR="$HOME/.nvm"
- nvm install 12.13.1
- npm i -g meteor
- meteor --version
- npm install -g mup
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- meteor npm install
- cd .deploy
- mup setup
- mup deploy
Here is the result, whith quite a lot of debugging information
Running with gitlab-runner 14.5.1 (de104fcd)
on docker RKp3-YrG
Preparing the "docker" executor
Using Docker executor with image ubuntu:20.04 ...
Pulling docker image ubuntu:20.04 ...
Using docker image sha256:ba6acccedd2923aee4c2acc6a23780b14ed4b8a5fa4e14e252a23b846df9b6c1 for ubuntu:20.04 with digest ubuntu#sha256:626ffe58f6e7566e00254b638eb7e0f3b11d4da9675088f4781a50ae288f3322 ...
Preparing environment 00:04
Running on runner-rkp3-yrg-project-10-concurrent-0 via gitlab-runner...
Getting source from Git repository 00:07
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/soxprox/apps/soxprox-code-server/soxprox_code_server_gui/.git/
Checking out 5c925242 as master...
Skipping Git submodules setup
Executing "step_script" stage of the job script 01:42
Using docker image sha256:ba6acccedd2923aee4c2acc6a23780b14ed4b8a5fa4e14e252a23b846df9b6c1 for ubuntu:20.04 with digest ubuntu#sha256:626ffe58f6e7566e00254b638eb7e0f3b11d4da9675088f4781a50ae288f3322 ...
$ adduser --disabled-password --gecos "" meteor_install
Adding user `meteor_install' ...
Adding new group `meteor_install' (1000) ...
Adding new user `meteor_install' (1000) with group `meteor_install' ...
Creating home directory `/home/meteor_install' ...
Copying files from `/etc/skel' ...
$ apt update -y
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1335 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [30.1 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [828 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [733 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [33.6 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1108 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1758 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [797 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [21.7 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [50.8 kB]
Fetched 20.1 MB in 4s (5258 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
1 package can be upgraded. Run 'apt list --upgradable' to see it.
$ apt install curl -y
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
ca-certificates krb5-locales libasn1-8-heimdal libbrotli1 libcurl4
libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
libheimntlm0-heimdal libhx509-5-heimdal libk5crypto3 libkeyutils1
libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common
libnghttp2-14 libpsl5 libroken18-heimdal librtmp1 libsasl2-2
libsasl2-modules libsasl2-modules-db libsqlite3-0 libssh-4 libssl1.1
libwind0-heimdal openssl publicsuffix
Suggested packages:
krb5-doc krb5-user libsasl2-modules-gssapi-mit
| libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp
libsasl2-modules-sql
The following NEW packages will be installed:
ca-certificates curl krb5-locales libasn1-8-heimdal libbrotli1 libcurl4
libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
libheimntlm0-heimdal libhx509-5-heimdal libk5crypto3 libkeyutils1
libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common
libnghttp2-14 libpsl5 libroken18-heimdal librtmp1 libsasl2-2
libsasl2-modules libsasl2-modules-db libsqlite3-0 libssh-4 libssl1.1
libwind0-heimdal openssl publicsuffix
0 upgraded, 32 newly installed, 0 to remove and 1 not upgraded.
Need to get 5447 kB of archives.
After this operation, 16.7 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.10 [1322 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 openssl amd64 1.1.1f-1ubuntu2.10 [620 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ca-certificates all 20210119~20.04.2 [145 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libsqlite3-0 amd64 3.31.1-4ubuntu0.2 [549 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 krb5-locales all 1.17-6ubuntu4.1 [11.4 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libkrb5support0 amd64 1.17-6ubuntu4.1 [30.9 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libk5crypto3 amd64 1.17-6ubuntu4.1 [79.9 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/main amd64 libkeyutils1 amd64 1.6-6ubuntu1 [10.2 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libkrb5-3 amd64 1.17-6ubuntu4.1 [330 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgssapi-krb5-2 amd64 1.17-6ubuntu4.1 [121 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 libpsl5 amd64 0.21.0-1ubuntu1 [51.5 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 publicsuffix all 20200303.0012-1 [111 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libbrotli1 amd64 1.0.7-6ubuntu0.1 [267 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal/main amd64 libroken18-heimdal amd64 7.7.0+dfsg-1ubuntu1 [41.8 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal/main amd64 libasn1-8-heimdal amd64 7.7.0+dfsg-1ubuntu1 [181 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal/main amd64 libheimbase1-heimdal amd64 7.7.0+dfsg-1ubuntu1 [29.7 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal/main amd64 libhcrypto4-heimdal amd64 7.7.0+dfsg-1ubuntu1 [87.9 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal/main amd64 libwind0-heimdal amd64 7.7.0+dfsg-1ubuntu1 [48.0 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal/main amd64 libhx509-5-heimdal amd64 7.7.0+dfsg-1ubuntu1 [107 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal/main amd64 libkrb5-26-heimdal amd64 7.7.0+dfsg-1ubuntu1 [208 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/main amd64 libheimntlm0-heimdal amd64 7.7.0+dfsg-1ubuntu1 [15.1 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal/main amd64 libgssapi3-heimdal amd64 7.7.0+dfsg-1ubuntu1 [96.1 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal/main amd64 libsasl2-modules-db amd64 2.1.27+dfsg-2 [14.9 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal/main amd64 libsasl2-2 amd64 2.1.27+dfsg-2 [49.3 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libldap-common all 2.4.49+dfsg-2ubuntu1.8 [16.6 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libldap-2.4-2 amd64 2.4.49+dfsg-2ubuntu1.8 [155 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal/main amd64 libnghttp2-14 amd64 1.40.0-1build1 [78.7 kB]
Get:28 http://archive.ubuntu.com/ubuntu focal/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d.1-2build1 [54.9 kB]
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libssh-4 amd64 0.9.3-2ubuntu2.2 [170 kB]
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcurl4 amd64 7.68.0-1ubuntu2.7 [234 kB]
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.7 [161 kB]
Get:32 http://archive.ubuntu.com/ubuntu focal/main amd64 libsasl2-modules amd64 2.1.27+dfsg-2 [49.1 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 5447 kB in 0s (13.6 MB/s)
Selecting previously unselected package libssl1.1:amd64.
(Reading database ... 4127 files and directories currently installed.)
Preparing to unpack .../00-libssl1.1_1.1.1f-1ubuntu2.10_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.10) ...
Selecting previously unselected package openssl.
Preparing to unpack .../01-openssl_1.1.1f-1ubuntu2.10_amd64.deb ...
Unpacking openssl (1.1.1f-1ubuntu2.10) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../02-ca-certificates_20210119~20.04.2_all.deb ...
Unpacking ca-certificates (20210119~20.04.2) ...
Selecting previously unselected package libsqlite3-0:amd64.
Preparing to unpack .../03-libsqlite3-0_3.31.1-4ubuntu0.2_amd64.deb ...
Unpacking libsqlite3-0:amd64 (3.31.1-4ubuntu0.2) ...
Selecting previously unselected package krb5-locales.
Preparing to unpack .../04-krb5-locales_1.17-6ubuntu4.1_all.deb ...
Unpacking krb5-locales (1.17-6ubuntu4.1) ...
Selecting previously unselected package libkrb5support0:amd64.
Preparing to unpack .../05-libkrb5support0_1.17-6ubuntu4.1_amd64.deb ...
Unpacking libkrb5support0:amd64 (1.17-6ubuntu4.1) ...
Selecting previously unselected package libk5crypto3:amd64.
Preparing to unpack .../06-libk5crypto3_1.17-6ubuntu4.1_amd64.deb ...
Unpacking libk5crypto3:amd64 (1.17-6ubuntu4.1) ...
Selecting previously unselected package libkeyutils1:amd64.
Preparing to unpack .../07-libkeyutils1_1.6-6ubuntu1_amd64.deb ...
Unpacking libkeyutils1:amd64 (1.6-6ubuntu1) ...
Selecting previously unselected package libkrb5-3:amd64.
Preparing to unpack .../08-libkrb5-3_1.17-6ubuntu4.1_amd64.deb ...
Unpacking libkrb5-3:amd64 (1.17-6ubuntu4.1) ...
Selecting previously unselected package libgssapi-krb5-2:amd64.
Preparing to unpack .../09-libgssapi-krb5-2_1.17-6ubuntu4.1_amd64.deb ...
Unpacking libgssapi-krb5-2:amd64 (1.17-6ubuntu4.1) ...
Selecting previously unselected package libpsl5:amd64.
Preparing to unpack .../10-libpsl5_0.21.0-1ubuntu1_amd64.deb ...
Unpacking libpsl5:amd64 (0.21.0-1ubuntu1) ...
Selecting previously unselected package publicsuffix.
Preparing to unpack .../11-publicsuffix_20200303.0012-1_all.deb ...
Unpacking publicsuffix (20200303.0012-1) ...
Selecting previously unselected package libbrotli1:amd64.
Preparing to unpack .../12-libbrotli1_1.0.7-6ubuntu0.1_amd64.deb ...
Unpacking libbrotli1:amd64 (1.0.7-6ubuntu0.1) ...
Selecting previously unselected package libroken18-heimdal:amd64.
Preparing to unpack .../13-libroken18-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libroken18-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libasn1-8-heimdal:amd64.
Preparing to unpack .../14-libasn1-8-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libasn1-8-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libheimbase1-heimdal:amd64.
Preparing to unpack .../15-libheimbase1-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libheimbase1-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libhcrypto4-heimdal:amd64.
Preparing to unpack .../16-libhcrypto4-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libhcrypto4-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libwind0-heimdal:amd64.
Preparing to unpack .../17-libwind0-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libwind0-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libhx509-5-heimdal:amd64.
Preparing to unpack .../18-libhx509-5-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libhx509-5-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libkrb5-26-heimdal:amd64.
Preparing to unpack .../19-libkrb5-26-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libkrb5-26-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libheimntlm0-heimdal:amd64.
Preparing to unpack .../20-libheimntlm0-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libheimntlm0-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libgssapi3-heimdal:amd64.
Preparing to unpack .../21-libgssapi3-heimdal_7.7.0+dfsg-1ubuntu1_amd64.deb ...
Unpacking libgssapi3-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Selecting previously unselected package libsasl2-modules-db:amd64.
Preparing to unpack .../22-libsasl2-modules-db_2.1.27+dfsg-2_amd64.deb ...
Unpacking libsasl2-modules-db:amd64 (2.1.27+dfsg-2) ...
Selecting previously unselected package libsasl2-2:amd64.
Preparing to unpack .../23-libsasl2-2_2.1.27+dfsg-2_amd64.deb ...
Unpacking libsasl2-2:amd64 (2.1.27+dfsg-2) ...
Selecting previously unselected package libldap-common.
Preparing to unpack .../24-libldap-common_2.4.49+dfsg-2ubuntu1.8_all.deb ...
Unpacking libldap-common (2.4.49+dfsg-2ubuntu1.8) ...
Selecting previously unselected package libldap-2.4-2:amd64.
Preparing to unpack .../25-libldap-2.4-2_2.4.49+dfsg-2ubuntu1.8_amd64.deb ...
Unpacking libldap-2.4-2:amd64 (2.4.49+dfsg-2ubuntu1.8) ...
Selecting previously unselected package libnghttp2-14:amd64.
Preparing to unpack .../26-libnghttp2-14_1.40.0-1build1_amd64.deb ...
Unpacking libnghttp2-14:amd64 (1.40.0-1build1) ...
Selecting previously unselected package librtmp1:amd64.
Preparing to unpack .../27-librtmp1_2.4+20151223.gitfa8646d.1-2build1_amd64.deb ...
Unpacking librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2build1) ...
Selecting previously unselected package libssh-4:amd64.
Preparing to unpack .../28-libssh-4_0.9.3-2ubuntu2.2_amd64.deb ...
Unpacking libssh-4:amd64 (0.9.3-2ubuntu2.2) ...
Selecting previously unselected package libcurl4:amd64.
Preparing to unpack .../29-libcurl4_7.68.0-1ubuntu2.7_amd64.deb ...
Unpacking libcurl4:amd64 (7.68.0-1ubuntu2.7) ...
Selecting previously unselected package curl.
Preparing to unpack .../30-curl_7.68.0-1ubuntu2.7_amd64.deb ...
Unpacking curl (7.68.0-1ubuntu2.7) ...
Selecting previously unselected package libsasl2-modules:amd64.
Preparing to unpack .../31-libsasl2-modules_2.1.27+dfsg-2_amd64.deb ...
Unpacking libsasl2-modules:amd64 (2.1.27+dfsg-2) ...
Setting up libkeyutils1:amd64 (1.6-6ubuntu1) ...
Setting up libpsl5:amd64 (0.21.0-1ubuntu1) ...
Setting up libssl1.1:amd64 (1.1.1f-1ubuntu2.10) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in #INC (you may need to install the Term::ReadLine module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libbrotli1:amd64 (1.0.7-6ubuntu0.1) ...
Setting up libsqlite3-0:amd64 (3.31.1-4ubuntu0.2) ...
Setting up libsasl2-modules:amd64 (2.1.27+dfsg-2) ...
Setting up libnghttp2-14:amd64 (1.40.0-1build1) ...
Setting up krb5-locales (1.17-6ubuntu4.1) ...
Setting up libldap-common (2.4.49+dfsg-2ubuntu1.8) ...
Setting up libkrb5support0:amd64 (1.17-6ubuntu4.1) ...
Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg-2) ...
Setting up librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2build1) ...
Setting up libk5crypto3:amd64 (1.17-6ubuntu4.1) ...
Setting up libsasl2-2:amd64 (2.1.27+dfsg-2) ...
Setting up libroken18-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up libkrb5-3:amd64 (1.17-6ubuntu4.1) ...
Setting up openssl (1.1.1f-1ubuntu2.10) ...
Setting up publicsuffix (20200303.0012-1) ...
Setting up libheimbase1-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up libasn1-8-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up libhcrypto4-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up ca-certificates (20210119~20.04.2) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in #INC (you may need to install the Term::ReadLine module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Updating certificates in /etc/ssl/certs...
128 added, 0 removed; done.
Setting up libwind0-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up libgssapi-krb5-2:amd64 (1.17-6ubuntu4.1) ...
Setting up libssh-4:amd64 (0.9.3-2ubuntu2.2) ...
Setting up libhx509-5-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up libkrb5-26-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up libheimntlm0-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up libgssapi3-heimdal:amd64 (7.7.0+dfsg-1ubuntu1) ...
Setting up libldap-2.4-2:amd64 (2.4.49+dfsg-2ubuntu1.8) ...
Setting up libcurl4:amd64 (7.68.0-1ubuntu2.7) ...
Setting up curl (7.68.0-1ubuntu2.7) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for ca-certificates (20210119~20.04.2) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
$ su meteor_install
$ echo $0
/usr/bin/bash
$ cd ~
$ ls -alh
total 16K
drwx------ 2 root root 4.0K Oct 6 16:58 .
drwxr-xr-x 1 root root 4.0K Jan 1 12:19 ..
-rw-r--r-- 1 root root 3.1K Dec 5 2019 .bashrc
-rw-r--r-- 1 root root 161 Dec 5 2019 .profile
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15037 100 15037 0 0 157k 0 --:--:-- --:--:-- --:--:-- 157k
=> Downloading nvm as script to '/root/.nvm'
=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
$ ls -alh
total 20K
drwx------ 1 root root 4.0K Jan 1 12:20 .
drwxr-xr-x 1 root root 4.0K Jan 1 12:19 ..
-rw-r--r-- 1 root root 3.3K Jan 1 12:20 .bashrc
drwxr-xr-x 2 root root 4.0K Jan 1 12:20 .nvm
-rw-r--r-- 1 root root 161 Dec 5 2019 .profile
$ source ~/.bashrc
$ cat ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u#\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u#\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user#host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u#\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
# . /etc/bash_completion
#fi
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
$ export NVM_DIR="$HOME/.nvm"
$ nvm install 12.13.1
/usr/bin/bash: line 143: nvm: command not found
Cleaning up project directory and file based variables 00:05
ERROR: Job failed: exit code 1

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
should work

Related

Pyodbc not installing in Docker image

I'm trying to use a Docker image with SQLAlchemy, which have dependencies with pyodbc. I'm trying to get the package installed from the Dockerfile, but I'm not finding the solution anywhere.
Right now, the basic structure of the directory could be like this:
root
| notebooks
| |testAlchemy.ipynb
| Dockerfile
| docker-compose.yml
| requirements.txt
Here are the contents of requirements.txt:
ipython-sql
pyodbc
psycopg2
sqlalchemy
Here my dockerfile:
FROM jupyter/datascience-notebook:latest
USER root
RUN apt-get update && \
apt-get install -y libpq-dev build-essential && \
apt-get clean && rm -rf var/lib/apt/lists/*
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
VOLUME /notebooks
WORKDIR /notebooks
And here the docker-compose:
version: "3"
services:
jupyter:
build:
context: ./jupyter
ports:
- "8888:8888"
links:
- postgres
environment:
- JUPYTER_TOKEN=1234
volumes:
- "./notebooks:/notebooks"
- "./data:/data"
postgres:
image: postgres
restart: always
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: passw
ports:
- 5432:5432
Then I do docker compose up and connect to jupyter server
In the notebook I have a really simple code:
from sqlalchemy.engine import URL
from sqlalchemy import create_engine
connection_string = f"DATABASE=operational;UID=user;PWD=passw;HOST=postgres"
connection_url = URL.create("mssql+pyodbc", query={"odbc_connect": connection_string})
engine = create_engine(connection_url)
But every time I try to run this code I get this error:
moduleNotFoundError img
And obviously, if I run !pip list in the notebook, pyodbc doesn't show anywhere. But I can run !pip install pyodbc with no problem
I'm sure I'm doing something wrong, but I don't know what.
Maybe try this recipe from their site, linked below, this is the CONDA+requirements file version:
FROM jupyter/datascience-notebook:latest
USER root
RUN apt-get update && \
apt-get install -y libpq-dev build-essential && \
apt-get clean && rm -rf var/lib/apt/lists/*
COPY --chown=${NB_UID}:${NB_GID} connect.py "/home/${NB_USER}"
COPY --chown=${NB_UID}:${NB_GID} requirements.txt /tmp/
#RUN pip install --quiet --no-cache-dir --requirement /tmp/requirements.txt && \
# fix-permissions "${CONDA_DIR}" && \
# fix-permissions "/home/${NB_USER}"
RUN mamba install --yes --file /tmp/requirements.txt && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
VOLUME /notebooks
WORKDIR /notebooks
using-mamba-install-or-pip-install-in-a-child-docker-image
Output
$ docker build --no-cache .
Sending build context to Docker daemon 42.06MB
Step 1/8 : FROM jupyter/datascience-notebook:latest
---> 03fcab0a8478
Step 2/8 : USER root
---> Running in a064e6e68110
Removing intermediate container a064e6e68110
---> f1681b20edb3
Step 3/8 : RUN apt-get update && apt-get install -y libpq-dev build-essential && apt-get clean && rm -rf var/lib/apt/lists/*
---> Running in 4622166e35a4
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [767 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1,792 kB]
Get:8 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [614 kB]
Get:9 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [4,642 B]
Get:10 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [522 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [573 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [8,056 B]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [914 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [952 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [7,275 B]
Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [3,175 B]
Fetched 24.7 MB in 5s (5,102 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
build-essential is already the newest version (12.9ubuntu3).
The following additional packages will be installed:
libpq5 libssl-dev
Suggested packages:
postgresql-doc-14 libssl-doc
The following NEW packages will be installed:
libpq-dev libpq5 libssl-dev
0 upgraded, 3 newly installed, 0 to remove and 5 not upgraded.
Need to get 2,659 kB of archives.
After this operation, 13.4 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpq5 amd64 14.5-0ubuntu0.22.04.1 [140 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libssl-dev amd64 3.0.2-0ubuntu1.7 [2,372 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpq-dev amd64 14.5-0ubuntu0.22.04.1 [147 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 2,659 kB in 1s (2,739 kB/s)
Selecting previously unselected package libpq5:amd64.
(Reading database ... 49774 files and directories currently installed.)
Preparing to unpack .../libpq5_14.5-0ubuntu0.22.04.1_amd64.deb ...
Unpacking libpq5:amd64 (14.5-0ubuntu0.22.04.1) ...
Selecting previously unselected package libssl-dev:amd64.
Preparing to unpack .../libssl-dev_3.0.2-0ubuntu1.7_amd64.deb ...
Unpacking libssl-dev:amd64 (3.0.2-0ubuntu1.7) ...
Selecting previously unselected package libpq-dev.
Preparing to unpack .../libpq-dev_14.5-0ubuntu0.22.04.1_amd64.deb ...
Unpacking libpq-dev (14.5-0ubuntu0.22.04.1) ...
Setting up libpq5:amd64 (14.5-0ubuntu0.22.04.1) ...
Setting up libssl-dev:amd64 (3.0.2-0ubuntu1.7) ...
Setting up libpq-dev (14.5-0ubuntu0.22.04.1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Removing intermediate container 4622166e35a4
---> 1c46f27c2516
Step 4/8 : COPY --chown=${NB_UID}:${NB_GID} connect.py "/home/${NB_USER}"
---> acab4c589e51
Step 5/8 : COPY --chown=${NB_UID}:${NB_GID} requirements.txt /tmp/
---> 3b506e4bdd02
Step 6/8 : RUN mamba install --yes --file /tmp/requirements.txt && mamba clean --all -f -y && fix-permissions "${CONDA_DIR}" && fix-permissions "/home/${NB_USER}"
---> Running in ced464550b21
Transaction
Prefix: /opt/conda
Updating specs:
- ipython-sql
- pyodbc
- psycopg2
- sqlalchemy
- ca-certificates
- certifi
- openssl
Package Version Build Channel Size
───────────────────────────────────────────────────────────────────────────
Install:
───────────────────────────────────────────────────────────────────────────
+ ipython-sql 0.3.9 pyhd8ed1ab_1004 conda-forge/noarch 19kB
+ libpq 14.5 he2d8382_1 conda-forge/linux-64 3MB
+ prettytable 3.4.1 pyhd8ed1ab_0 conda-forge/noarch 27kB
+ psycopg2 2.9.3 py310h5764c6d_1 conda-forge/linux-64 185kB
+ pyodbc 4.0.35 py310hd8f1fbe_0 conda-forge/linux-64 79kB
+ sqlparse 0.4.3 pyhd8ed1ab_0 conda-forge/noarch 36kB
Summary:
Install: 6 packages
Total download: 3MB
───────────────────────────────────────────────────────────────────────────
Looking for: ['ipython-sql', 'pyodbc', 'psycopg2', 'sqlalchemy']
Pinned packages:
- python 3.10.*
- python 3.10.6
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Will remove 1 package cache(s).
Removing intermediate container ced464550b21
---> ddfbf0e82d8a
Step 7/8 : VOLUME /notebooks
---> Running in 6991a675e302
Removing intermediate container 6991a675e302
---> 1cadb017d264
Step 8/8 : WORKDIR /notebooks
---> Running in 44b9027d2e6d
Removing intermediate container 44b9027d2e6d
---> c888d15b3e82
Successfully built c888d15b3e82

Why I cannot run `apt update` inside a fresh ubuntu:22.04? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last month.
The community reviewed whether to reopen this question last month and left it closed:
Original close reason(s) were not resolved
Improve this question
I currently don't manage to run apt update inside a fresh ubuntu:22.04 (codename jammy).
Protocol
$ docker --version
Docker version 20.10.2, build 2291f61
$ docker run --init --rm -it ubuntu:22.04
root#123456789:/# apt update
Observed
$ docker run --init --rm -it ubuntu:22.04
root#6444bf2cb8b4:/# apt update
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [90.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [90.7 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [90.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Fetched 20.2 MB in 1s (17.6 MB/s)
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
root#6444bf2cb8b4:/#
Expected
apt update pass like on a ubuntu:20.04 base image...
note: same issue with apt-get install ...
ref: https://hub.docker.com/_/ubuntu
Seems this is related to the use of the syscall clone3 by Glibc >= 2.34...
So you need Docker >= 20.10.9 to fix it.
ref: https://github.com/moby/moby/pull/42681
ref: https://pascalroeleven.nl/2021/09/09/ubuntu-21-10-and-fedora-35-in-docker/
I ran into the same issue. Here is my tactical work-around.
For context ...
I am working inside a Gitpod instance.
$ docker --version
Docker version 20.10.12, build e91ed57
$ docker pull ubuntu:22.04
$ docker run --rm -it ubuntu:22.04 /bin/bash
root#2fcf92fb7c84:/# apt update
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [90.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [90.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [90.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Fetched 20.2 MB in 2s (11.1 MB/s)
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
Quick nano install ...
Despite the error message above, the update was sufficient to install nano. I ignore the misleading error message at the end of the nano install.
root#3958950e9c57:/# apt install nano
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
:
E: Problem executing scripts DPkg::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
My fix ...
I use nano to edit /etc/apt/apt.conf.d/docker-clean, commenting out the second line (APT::...). I subsequently ran into a similar error message with line 1 (DPkg::...); so, it too gets commented out.
It might be okay to just remove docker-clean all together; but for now, I have left one line in place.
Both '//' and '#' can be used to comment out lines.
root#3958950e9c57:/# nano /etc/apt/apt.conf.d/docker-clean
.. nano session not shown ..
root#3958950e9c57:/# cat /etc/apt/apt.conf.d/docker-clean
# DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };
# APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };
Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";
The results ...
The confusing message resulting from the now commented-out lines is gone.
root#beab61fbde20:/# apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Required Improvement ...
A better solution would be to repair the line that I have commented out. I was not able to find the right edits; so, just left the line commented out.
In Docker ...
I use sed in lieu of nano.
FROM ubuntu:22.04
USER root
RUN sed -i -e 's/^APT/# APT/' -e 's/^DPkg/# DPkg/' \
/etc/apt/apt.conf.d/docker-clean
Then, tag an adjusted Ubuntu image for local use.
docker build -t fixed-ubuntu:22.04 -f Dockerfile .
I upgraded docker engine to version 20.10.14 and it resolved the problem.
I had docker 20.10.18 (latest at time writing) which didn't work, with 20.10.14 it started to work.

"Unable to locate package git" when running GitLab CI/CD pipeline

I am trying to set up a GitLab CI/CD pipeline with this following .gitlab-ci.yml file:
stages:
- test
image: "ros:foxy-ros-base-focal"
before_script:
- apt-get -y update && apt-get install -y \
git wget qt5-default \
python3-osrf-pycommon \
python3-catkin-tools \
python3-rosdep \
python3-vcstool \
python3-pip \
python3-colcon-common-extensions \
apt-utils
- rm -rf /var/lib/apt/lists/*
- /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build"
- echo "source /root/dev_ws/install/setup.bash" >> /opt/ros/${ROS_DISTRO}/setup.bash
test_a:
stage: test
script:
- pip3 install pytest
- python -m pytest test_utils.py -vv -s
I am starting from the ROS2 Foxy Base Focal Docker image. However, despite running apt-get update, I still can't find many of the packages, including git as well as several other ROS2 packages. Full log here:
Running with gitlab-runner 13.8.0 (775dd39d)
on docker-auto-scale fa6cab46
Preparing the "docker+machine" executor
00:27
Using Docker executor with image ros:foxy-ros-base-focal ...
Pulling docker image ros:foxy-ros-base-focal ...
Using docker image sha256:59cf2af10ce4181bf4effbc683375f5e201bfe072c808c75fb3ee903b98265b9 for ros:foxy-ros-base-focal with digest ros#sha256:4f924ff4fdee6b7c999ad6bc013741bdf8430466c7a27842ac6255255ce9ae66 ...
Preparing environment
00:02
Running on runner-fa6cab46-project-23977848-concurrent-0 via runner-fa6cab46-srm-1611897044-53c1946d...
Getting source from Git repository
00:02
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/imda_dsl/vama-2/scene-understanding/scene-understanding-manager/.git/
Created fresh repository.
Checking out fc385931 as dev...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:05
$ apt-get -y update && apt-get install -y \ git wget qt5-default \ python3-osrf-pycommon \ python3-catkin-tools \ python3-rosdep \ python3-vcstool \ python3-pip \ python3-colcon-common-extensions \ apt-utils
Get:1 http://packages.ros.org/ros2/ubuntu focal InRelease [4670 B]
Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:4 http://packages.ros.org/ros2/ubuntu focal/main amd64 Packages [451 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [161 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [598 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [659 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [13.3 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1003 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [21.1 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [194 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [920 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [4301 B]
Fetched 17.4 MB in 2s (7001 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package git
E: Unable to locate package python3-osrf-pycommon
E: Unable to locate package python3-catkin-tools
E: Unable to locate package python3-rosdep
E: Unable to locate package python3-vcstool
E: Unable to locate package python3-pip
E: Unable to locate package python3-colcon-common-extensions
E: Unable to locate package apt-utils
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
Installing packages or even running update commands in your .gitlab-ci.yml is generally against best practices for a CI/CD container because each and every job that runs will have to do the same thing, costing a lot of time as you run more pipelines. If you can't find an existing Docker image that has the packages you need (so as an example, python3 and git), you can create your own images. If you need to extend the image from your job, ros:foxy-ros-base-focal, create a Dockerfile file with the following contents:
FROM ros:foxy-ros-base-focal
MAINTAINER your name "your email"
RUN apt-get update -yqq
RUN apt-get install -yqq git
You can install/configure whatever else you need to do in there too, then when you're done build the image:
docker build /path/to/dir-with-dockerfile -t tagname:version
Once the build is done you can verify the tag is correct with docker images, then you can push it to a registry (docker hub, gitlab's registry if enabled, private registry, etc) with:
docker login my.hub.example.com
docker push my.hub.example.com/tagname:version
Then in your .gitlab-ci.yml file, you can use the tagname:version image in your jobs:
stages:
- test
image: "tagname:version"
...
If you have to auth to use your registry, you'll have to review the docs here https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#define-an-image-from-a-private-container-registry, and the general docs for using docker images in your pipelines is here: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html

I built a docker image but got an error: returned a non-zero code: 1

EDIT
log after Dockerfile correction (add -y parameters)
C:\Users\jl3.PRT-063\Desktop\Docker>docker build -t ocr-docker-build-starwars .
Sending build context to Docker daemon 3.072kB
Step 1/8 : FROM openclassrooms/build_image
---> 7f6c67ae7dae
Step 2/8 : RUN apt-get update && apt-get -y install nginx
---> Running in b1d4c4d5fb1c
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://deb.debian.org/debian stretch-updates/main amd64 Packages [2596 B]
Get:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [558 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Fetched 7907 kB in 3s (2122 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
fontconfig-config fonts-dejavu-core geoip-database libbsd0 libexpat1
libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu57 libjbig0
libjpeg62-turbo libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
libnginx-mod-http-echo libnginx-mod-http-geoip
libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
libxslt1.1 nginx-common nginx-full sgml-base ucf xml-core
Suggested packages:
libgd-tools geoip-bin fcgiwrap nginx-doc ssl-cert sgml-base-doc debhelper
The following NEW packages will be installed:
fontconfig-config fonts-dejavu-core geoip-database libbsd0 libexpat1
libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu57 libjbig0
libjpeg62-turbo libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
libnginx-mod-http-echo libnginx-mod-http-geoip
libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
libxslt1.1 nginx nginx-common nginx-full sgml-base ucf xml-core
0 upgraded, 40 newly installed, 0 to remove and 13 not upgraded.
Need to get 18.7 MB of archives.
After this operation, 59.4 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 libxau6 amd64 1:1.0.8-1 [20.7 kB]
Get:2 http://security.debian.org/debian-security stretch/updates/main amd64 libjpeg62-turbo amd64 1:1.5.1-2+deb9u1 [134 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 sgml-base all 1.29 [14.8 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 libssl1.1 amd64 1.1.0l-1~deb9u1 [1358 kB]
Get:5 http://deb.debian.org/debian stretch/main amd64 libicu57 amd64 57.1-6+deb9u4 [7699 kB]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 libx11-data all 2:1.6.4-3+deb9u2 [291 kB]
Get:7 http://security.debian.org/debian-security stretch/updates/main amd64 libx11-6 amd64 2:1.6.4-3+deb9u2 [748 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 libxml2 amd64 2.9.4+dfsg1-2.2+deb9u2 [920 kB]
Get:9 http://security.debian.org/debian-security stretch/updates/main amd64 nginx-common all 1.10.3-1+deb9u5 [105 kB]
Get:10 http://deb.debian.org/debian stretch/main amd64 ucf all 3.0036 [70.2 kB]
Get:11 http://deb.debian.org/debian stretch/main amd64 fonts-dejavu-core all 2.37-1 [1068 kB]
Get:12 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-auth-pam amd64 1.10.3-1+deb9u5 [86.3 kB]
Get:13 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-dav-ext amd64 1.10.3-1+deb9u5 [88.0 kB]
Get:14 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-echo amd64 1.10.3-1+deb9u5 [97.4 kB]
Get:15 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-geoip amd64 1.10.3-1+deb9u5 [87.5 kB]
Get:16 http://deb.debian.org/debian stretch/main amd64 fontconfig-config all 2.11.0-6.7 [271 kB]
Get:17 http://deb.debian.org/debian stretch/main amd64 geoip-database all 20170512-1 [2112 kB]
Get:18 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-image-filter amd64 1.10.3-1+deb9u5 [90.5 kB]
Get:19 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-subs-filter amd64 1.10.3-1+deb9u5 [89.4 kB]
Get:20 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-upstream-fair amd64 1.10.3-1+deb9u5 [89.5 kB]
Get:21 http://deb.debian.org/debian stretch/main amd64 libbsd0 amd64 0.8.3-1 [83.0 kB]
Get:22 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.10.3-1+deb9u5 [89.4 kB]
Get:23 http://deb.debian.org/debian stretch/main amd64 libexpat1 amd64 2.2.0-2+deb9u3 [83.7 kB]
Get:24 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-mail amd64 1.10.3-1+deb9u5 [118 kB]
Get:25 http://deb.debian.org/debian stretch/main amd64 libpng16-16 amd64 1.6.28-1+deb9u1 [280 kB]
Get:26 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-stream amd64 1.10.3-1+deb9u5 [110 kB]
Get:27 http://security.debian.org/debian-security stretch/updates/main amd64 nginx-full amd64 1.10.3-1+deb9u5 [459 kB]
Get:28 http://deb.debian.org/debian stretch/main amd64 libfreetype6 amd64 2.6.3-3.2+deb9u1 [438 kB]
Get:29 http://security.debian.org/debian-security stretch/updates/main amd64 nginx all 1.10.3-1+deb9u5 [82.0 kB]
Get:30 http://deb.debian.org/debian stretch/main amd64 libfontconfig1 amd64 2.11.0-6.7+b1 [331 kB]
Get:31 http://deb.debian.org/debian stretch/main amd64 libjbig0 amd64 2.1-3.1+b2 [31.0 kB]
Get:32 http://deb.debian.org/debian stretch/main amd64 libtiff5 amd64 4.0.8-2+deb9u5 [239 kB]
Get:33 http://deb.debian.org/debian stretch/main amd64 libwebp6 amd64 0.5.2-1 [235 kB]
Get:34 http://deb.debian.org/debian stretch/main amd64 libxdmcp6 amd64 1:1.1.2-3 [26.3 kB]
Get:35 http://deb.debian.org/debian stretch/main amd64 libxcb1 amd64 1.12-1 [133 kB]
Get:36 http://deb.debian.org/debian stretch/main amd64 libxpm4 amd64 1:3.5.12-1 [49.1 kB]
Get:37 http://deb.debian.org/debian stretch/main amd64 libgd3 amd64 2.2.4-2+deb9u5 [132 kB]
Get:38 http://deb.debian.org/debian stretch/main amd64 libgeoip1 amd64 1.6.9-4 [90.5 kB]
Get:39 http://deb.debian.org/debian stretch/main amd64 libxslt1.1 amd64 1.1.29-2.1+deb9u2 [233 kB]
Get:40 http://deb.debian.org/debian stretch/main amd64 xml-core all 0.17 [23.2 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 18.7 MB in 4s (4265 kB/s)
Selecting previously unselected package libxau6:amd64.
(Reading database ... 6499 files and directories currently installed.)
Preparing to unpack .../00-libxau6_1%3a1.0.8-1_amd64.deb ...
Unpacking libxau6:amd64 (1:1.0.8-1) ...
Selecting previously unselected package sgml-base.
Preparing to unpack .../01-sgml-base_1.29_all.deb ...
Unpacking sgml-base (1.29) ...
Selecting previously unselected package libssl1.1:amd64.
Preparing to unpack .../02-libssl1.1_1.1.0l-1~deb9u1_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.0l-1~deb9u1) ...
Selecting previously unselected package libicu57:amd64.
Preparing to unpack .../03-libicu57_57.1-6+deb9u4_amd64.deb ...
Unpacking libicu57:amd64 (57.1-6+deb9u4) ...
Selecting previously unselected package libxml2:amd64.
Preparing to unpack .../04-libxml2_2.9.4+dfsg1-2.2+deb9u2_amd64.deb ...
Unpacking libxml2:amd64 (2.9.4+dfsg1-2.2+deb9u2) ...
Selecting previously unselected package ucf.
Preparing to unpack .../05-ucf_3.0036_all.deb ...
Moving old data out of the way
Unpacking ucf (3.0036) ...
Selecting previously unselected package fonts-dejavu-core.
Preparing to unpack .../06-fonts-dejavu-core_2.37-1_all.deb ...
Unpacking fonts-dejavu-core (2.37-1) ...
Selecting previously unselected package fontconfig-config.
Preparing to unpack .../07-fontconfig-config_2.11.0-6.7_all.deb ...
Unpacking fontconfig-config (2.11.0-6.7) ...
Selecting previously unselected package geoip-database.
Preparing to unpack .../08-geoip-database_20170512-1_all.deb ...
Unpacking geoip-database (20170512-1) ...
Selecting previously unselected package libbsd0:amd64.
Preparing to unpack .../09-libbsd0_0.8.3-1_amd64.deb ...
Unpacking libbsd0:amd64 (0.8.3-1) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../10-libexpat1_2.2.0-2+deb9u3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.0-2+deb9u3) ...
Selecting previously unselected package libpng16-16:amd64.
Preparing to unpack .../11-libpng16-16_1.6.28-1+deb9u1_amd64.deb ...
Unpacking libpng16-16:amd64 (1.6.28-1+deb9u1) ...
Selecting previously unselected package libfreetype6:amd64.
Preparing to unpack .../12-libfreetype6_2.6.3-3.2+deb9u1_amd64.deb ...
Unpacking libfreetype6:amd64 (2.6.3-3.2+deb9u1) ...
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack .../13-libfontconfig1_2.11.0-6.7+b1_amd64.deb ...
Unpacking libfontconfig1:amd64 (2.11.0-6.7+b1) ...
Selecting previously unselected package libjpeg62-turbo:amd64.
Preparing to unpack .../14-libjpeg62-turbo_1%3a1.5.1-2+deb9u1_amd64.deb ...
Unpacking libjpeg62-turbo:amd64 (1:1.5.1-2+deb9u1) ...
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack .../15-libjbig0_2.1-3.1+b2_amd64.deb ...
Unpacking libjbig0:amd64 (2.1-3.1+b2) ...
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack .../16-libtiff5_4.0.8-2+deb9u5_amd64.deb ...
Unpacking libtiff5:amd64 (4.0.8-2+deb9u5) ...
Selecting previously unselected package libwebp6:amd64.
Preparing to unpack .../17-libwebp6_0.5.2-1_amd64.deb ...
Unpacking libwebp6:amd64 (0.5.2-1) ...
Selecting previously unselected package libxdmcp6:amd64.
Preparing to unpack .../18-libxdmcp6_1%3a1.1.2-3_amd64.deb ...
Unpacking libxdmcp6:amd64 (1:1.1.2-3) ...
Selecting previously unselected package libxcb1:amd64.
Preparing to unpack .../19-libxcb1_1.12-1_amd64.deb ...
Unpacking libxcb1:amd64 (1.12-1) ...
Selecting previously unselected package libx11-data.
Preparing to unpack .../20-libx11-data_2%3a1.6.4-3+deb9u2_all.deb ...
Unpacking libx11-data (2:1.6.4-3+deb9u2) ...
Selecting previously unselected package libx11-6:amd64.
Preparing to unpack .../21-libx11-6_2%3a1.6.4-3+deb9u2_amd64.deb ...
Unpacking libx11-6:amd64 (2:1.6.4-3+deb9u2) ...
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack .../22-libxpm4_1%3a3.5.12-1_amd64.deb ...
Unpacking libxpm4:amd64 (1:3.5.12-1) ...
Selecting previously unselected package libgd3:amd64.
Preparing to unpack .../23-libgd3_2.2.4-2+deb9u5_amd64.deb ...
Unpacking libgd3:amd64 (2.2.4-2+deb9u5) ...
Selecting previously unselected package libgeoip1:amd64.
Preparing to unpack .../24-libgeoip1_1.6.9-4_amd64.deb ...
Unpacking libgeoip1:amd64 (1.6.9-4) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../25-nginx-common_1.10.3-1+deb9u5_all.deb ...
Unpacking nginx-common (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-auth-pam.
Preparing to unpack .../26-libnginx-mod-http-auth-pam_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-auth-pam (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-dav-ext.
Preparing to unpack .../27-libnginx-mod-http-dav-ext_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-dav-ext (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-echo.
Preparing to unpack .../28-libnginx-mod-http-echo_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-echo (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-geoip.
Preparing to unpack .../29-libnginx-mod-http-geoip_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-geoip (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack .../30-libnginx-mod-http-image-filter_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-image-filter (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-subs-filter.
Preparing to unpack .../31-libnginx-mod-http-subs-filter_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-subs-filter (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-upstream-fair.
Preparing to unpack .../32-libnginx-mod-http-upstream-fair_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-upstream-fair (1.10.3-1+deb9u5) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../33-libxslt1.1_1.1.29-2.1+deb9u2_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.29-2.1+deb9u2) ...
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack .../34-libnginx-mod-http-xslt-filter_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-xslt-filter (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack .../35-libnginx-mod-mail_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-mail (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-stream.
Preparing to unpack .../36-libnginx-mod-stream_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-stream (1.10.3-1+deb9u5) ...
Selecting previously unselected package nginx-full.
Preparing to unpack .../37-nginx-full_1.10.3-1+deb9u5_amd64.deb ...
Unpacking nginx-full (1.10.3-1+deb9u5) ...
Selecting previously unselected package nginx.
Preparing to unpack .../38-nginx_1.10.3-1+deb9u5_all.deb ...
Unpacking nginx (1.10.3-1+deb9u5) ...
Selecting previously unselected package xml-core.
Preparing to unpack .../39-xml-core_0.17_all.deb ...
Unpacking xml-core (0.17) ...
Setting up libexpat1:amd64 (2.2.0-2+deb9u3) ...
Setting up libjpeg62-turbo:amd64 (1:1.5.1-2+deb9u1) ...
Setting up geoip-database (20170512-1) ...
Setting up libpng16-16:amd64 (1.6.28-1+deb9u1) ...
Setting up libjbig0:amd64 (2.1-3.1+b2) ...
Setting up fonts-dejavu-core (2.37-1) ...
Setting up nginx-common (1.10.3-1+deb9u5) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in #INC (you may need to install the Term::ReadLine module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libnginx-mod-http-subs-filter (1.10.3-1+deb9u5) ...
Setting up libtiff5:amd64 (4.0.8-2+deb9u5) ...
Setting up sgml-base (1.29) ...
Setting up libgeoip1:amd64 (1.6.9-4) ...
Setting up libicu57:amd64 (57.1-6+deb9u4) ...
Setting up libbsd0:amd64 (0.8.3-1) ...
Setting up ucf (3.0036) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in #INC (you may need to install the Term::ReadLine module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libxml2:amd64 (2.9.4+dfsg1-2.2+deb9u2) ...
Setting up libfreetype6:amd64 (2.6.3-3.2+deb9u1) ...
Setting up libxslt1.1:amd64 (1.1.29-2.1+deb9u2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libssl1.1:amd64 (1.1.0l-1~deb9u1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in #INC (you may need to install the Term::ReadLine module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libnginx-mod-http-auth-pam (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-http-dav-ext (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-mail (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-http-xslt-filter (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-http-upstream-fair (1.10.3-1+deb9u5) ...
Setting up libxdmcp6:amd64 (1:1.1.2-3) ...
Setting up xml-core (0.17) ...
Setting up libnginx-mod-http-geoip (1.10.3-1+deb9u5) ...
Setting up libx11-data (2:1.6.4-3+deb9u2) ...
Setting up libxau6:amd64 (1:1.0.8-1) ...
Setting up libwebp6:amd64 (0.5.2-1) ...
Setting up fontconfig-config (2.11.0-6.7) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in #INC (you may need to install the Term::ReadLine module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libnginx-mod-stream (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-http-echo (1.10.3-1+deb9u5) ...
Setting up libxcb1:amd64 (1.12-1) ...
Setting up libfontconfig1:amd64 (2.11.0-6.7+b1) ...
Setting up libx11-6:amd64 (2:1.6.4-3+deb9u2) ...
Setting up libxpm4:amd64 (1:3.5.12-1) ...
Setting up libgd3:amd64 (2.2.4-2+deb9u5) ...
Setting up libnginx-mod-http-image-filter (1.10.3-1+deb9u5) ...
Setting up nginx-full (1.10.3-1+deb9u5) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up nginx (1.10.3-1+deb9u5) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for sgml-base (1.29) ...
Removing intermediate container b1d4c4d5fb1c
---> ec084d39789a
Step 3/8 : ADD . /app/
---> 1d49a8aae193
Step 4/8 : WORKDIR /app
---> Running in 291d3fab8c4f
Removing intermediate container 291d3fab8c4f
---> 0905210b7eec
Step 5/8 : RUN npm install
---> Running in ce3790948e23
/bin/sh: 1: npm: not found
The command '/bin/sh -c npm install' returned a non-zero code: 127
I am newbie in Docker and follow the OC tutorial.
I try to complete an exercice but failed:
For this question, you will create your Dockerfile using the openclassrooms / build_image image as the starting image.
Your image must be equipped with an Nginx server that you will therefore need to install via the Dockerfile. Once done, build and then launch your image, and a new Star Wars phrase will reveal itself to you!
C:/user/Desktop/Docker/
.dockerignore
Dockerfile
Dockerfile
FROM openclassrooms/build_image
RUN apt-get update \
&& apt-get -y install nginx
ADD . /app/
WORKDIR /app
EXPOSE 2368
VOLUME /app/logs
CMD run -d -p 8080:80 nginx .
I run docker build -t ocr-docker-build-starwars . to build my image and got an error message:
The command '/bin/sh -c apt update && apt install nginx' returned a non-zero code: 1
Where is the problem with my script?
log
C:\Users\jl3.PRT-063\Desktop\Docker>docker build -t ocr-docker-build-starwars .
Sending build context to Docker daemon 3.072kB
Step 1/8 : FROM openclassrooms/build_image
---> 7f6c67ae7dae
Step 2/8 : RUN apt-get update && apt-get install nginx
---> Running in 533a0cba0922
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [558 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main amd64 Packages [2596 B]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Fetched 7907 kB in 4s (1675 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
fontconfig-config fonts-dejavu-core geoip-database libbsd0 libexpat1
libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu57 libjbig0
libjpeg62-turbo libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
libnginx-mod-http-echo libnginx-mod-http-geoip
libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
libxslt1.1 nginx-common nginx-full sgml-base ucf xml-core
Suggested packages:
libgd-tools geoip-bin fcgiwrap nginx-doc ssl-cert sgml-base-doc debhelper
The following NEW packages will be installed:
fontconfig-config fonts-dejavu-core geoip-database libbsd0 libexpat1
libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu57 libjbig0
libjpeg62-turbo libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
libnginx-mod-http-echo libnginx-mod-http-geoip
libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
libxslt1.1 nginx nginx-common nginx-full sgml-base ucf xml-core
0 upgraded, 40 newly installed, 0 to remove and 13 not upgraded.
Need to get 18.7 MB of archives.
After this operation, 59.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
The command '/bin/sh -c apt-get update && apt-get install nginx' returned a non-zero code: 1
The Docker build is failing because the apt command prompts the user for confirmation. To fix this, you can use the -y flag to install silently:
apt-get update \
&& apt-get -y install nginx

Git installation error on ubuntu on Docker [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I want to install git. But this error is issued.
Before that, java and maven were installed normally.
What could be the problem?
root#2367f80df87a:/# apt install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
git-man less libasn1-8-heimdal libcurl3-gnutls liberror-perl libgdbm-compat4 libgdbm5 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libldap-2.4-2 libldap-common libnghttp2-14 libperl5.26 libpsl5 libroken18-heimdal librtmp1
libsasl2-2 libsasl2-modules libsasl2-modules-db libssl1.0.0 libwind0-heimdal netbase openssh-client patch perl perl-modules-5.26 publicsuffix xauth
Suggested packages:
gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn gdbm-l10n
libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql keychain libpam-ssh
monkeysphere ssh-askpass ed diffutils-doc perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl make
The following NEW packages will be installed:
git git-man less libasn1-8-heimdal libcurl3-gnutls liberror-perl libgdbm-compat4 libgdbm5 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libldap-2.4-2 libldap-common libnghttp2-14 libperl5.26 libpsl5 libroken18-heimdal librtmp1
libsasl2-2 libsasl2-modules libsasl2-modules-db libssl1.0.0 libwind0-heimdal netbase openssh-client patch perl perl-modules-5.26 publicsuffix xauth
0 upgraded, 33 newly installed, 0 to remove and 2 not upgraded.
Need to get 14.8 MB of archives.
After this operation, 89.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Ign:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 perl-modules-5.26 all 5.26.1-6ubuntu0.3
Err:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 libgdbm5 amd64 1.14.1-6
Temporary failure resolving 'archive.ubuntu.com'
Err:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 perl-modules-5.26 all 5.26.1-6ubuntu0.3
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic/main amd64 libgdbm-compat4 amd64 1.14.1-6
Temporary failure resolving 'archive.ubuntu.com'
Ign:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libperl5.26 amd64 5.26.1-6ubuntu0.3
0% [Connecting to security.ubuntu.com] [Connecting to archive.ubuntu.com]
And it goes on endlessly...
upd.
Answer for #LinPy:
root#2367f80df87a:/# apt-get update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com'
0% [Connecting to archive.ubuntu.com]^C^[get update && apt-get install git
root#2367f80df87a:/# apt-get update && apt-get install git
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
When executing the "apt-get update" command, I have a similar error.
You probably have a DNS issue in your docker engine.
You can test the theory by running:
docker run busybox ping archive.ubuntu.com
and see if it resolves.
Then, do the same, but with allowing host network or explicitly providing DNS:
docker run --network host busybox ping archive.ubuntu.com
docker run --dns 8.8.8.8 busybox ping archive.ubuntu.com
For a permanent solution, you might need to edit your /etc/docker/daemon.json and restart the docker engine:
{
"dns": ["192.10.0.2", "8.8.8.8"]
}
Reference here

Resources