I have the following dockerfile:
FROM ubuntu:20.04
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
wget \
build-essential \
curl \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN wget --no-check-certificate -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash miniconda.sh -b \
&& rm -f miniconda.sh
ENV PATH="/root/miniconda3/bin:${PATH}"
WORKDIR /home
#COPY download_model.sh download_model.sh
#RUN /bin/bash /home/download_model.sh
RUN conda config --set ssl_verify false
#RUN curl -I https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json -k
RUN conda install pytorch==1.4.0 torchvision==0.5.0 cpuonly -c pytorch
COPY requirements.txt requirements.txt
RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
#RUN pip install -r requirements.txt
COPY m39v1.tar ./
RUN tar -xvf m39v1.tar && rm -f m39v1.tar
COPY src src/
COPY test_bin test_bin/
COPY run_paraphraser.py run_paraphraser.py
ENTRYPOINT ["python", "run_paraphraser.py"]
I'm having problems with running pip install, more specifically i've had to replace this command RUN pip install -r requirements.txt with RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
Otherwise i was getting this wierd ssl certificate error:
#12 8.692 Could not fetch URL https://pypi.org/simple/config/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/config/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))) - skipping
#12 8.694 ERROR: Could not find a version that satisfies the requirement config (from versions: none)
#12 8.695 ERROR: No matching distribution found for config
#12 9.195 Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))) - skipping
#12 ERROR: executor failed running [/bin/sh -c pip install -r requirements.txt config --global http.sslVerify false]: exit code:
I'm on a company laptop, however the problem arised only when trying to reach the website from docker, i noticed the problem when i added this line RUN curl -I https://pypi.org/simple/pip/ to the dockerfile to test connection to pip:
#10 [ 7/14] RUN curl -I https://pypi.org/simple/pip/
#10 sha256:95fa072f708fe705a1d5a9f7af20972255a078ce1df2cf90ad52a4d9a844ec40
#10 0.378 % Total % Received % Xferd Average Speed Time Time Time Current
#10 0.378 Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
#10 0.412 curl: (77) error setting certificate verify locations:
#10 0.412 CAfile: /etc/ssl/certs/ca-certificates.crt
#10 0.412 CApath: /etc/ssl/certs
#10 ERROR: executor failed running [/bin/sh -c curl -I https://pypi.org/simple/pip/]: exit code: 77
As i've mentioned replacing pip install with this trusted version seemed to work initially RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
However when building the dockerfile i ended up with another error which i can't really wrap my head around:
#13 [ 9/14] RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
#13 sha256:1e3540de7554d95d43c31a02a3079a9d8c5a8104255b93ca63d4dd006e1df31e
#13 0.881 Collecting sentencepiece==0.1.86
#13 1.057 Downloading sentencepiece-0.1.86-cp37-cp37m-manylinux1_x86_64.whl (1.0 MB)
#13 1.368 Collecting fairseq==0.9.0
#13 3.330 Downloading fairseq-0.9.0.tar.gz (306 kB)
#13 12.30 ERROR: Command errored out with exit status 1:
#13 12.30 command: /root/miniconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_2im9ux1/fairseq/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_2im9ux1/fairseq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-_2im9ux1/fairseq/pip-egg-info
#13 12.30 cwd: /tmp/pip-install-_2im9ux1/fairseq/
#13 12.30 Complete output (39 lines):
#13 12.30 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /simple/cython/
#13 12.30 ERROR: Could not find a version that satisfies the requirement cython (from versions: none)
#13 12.30 ERROR: No matching distribution found for cython
#13 12.30 /root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
#13 12.30 SetuptoolsDeprecationWarning,
#13 12.30 Traceback (most recent call last):
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py", line 82, in fetch_build_egg
#13 12.30 subprocess.check_call(cmd)
#13 12.30 File "/root/miniconda3/lib/python3.7/subprocess.py", line 363, in check_call
#13 12.30 raise CalledProcessError(retcode, cmd)
#13 12.30 subprocess.CalledProcessError: Command '['/root/miniconda3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp91n1bbee', '--quiet', 'cython']' returned non-zero exit status 1.
#13 12.30
#13 12.30 The above exception was the direct cause of the following exception:
#13 12.30
#13 12.30 Traceback (most recent call last):
#13 12.30 File "<string>", line 1, in <module>
#13 12.30 File "/tmp/pip-install-_2im9ux1/fairseq/setup.py", line 161, in <module>
#13 12.30 zip_safe=False,
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 86, in setup
#13 12.30 _install_setup_requires(attrs)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
#13 12.30 dist.fetch_build_eggs(dist.setup_requires)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/dist.py", line 878, in fetch_build_eggs
#13 12.30 replace_conflicting=True,
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
#13 12.30 replace_conflicting=replace_conflicting
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1075, in best_match
#13 12.30 return self.obtain(req, installer)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1087, in obtain
#13 12.30 return installer(requirement)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
#13 12.30 return fetch_build_egg(self, req)
#13 12.30 File "/root/miniconda3/lib/python3.7/site-packages/setuptools/installer.py", line 84, in fetch_build_egg
#13 12.30 raise DistutilsError(str(e)) from e
#13 12.30 distutils.errors.DistutilsError: Command '['/root/miniconda3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp91n1bbee', '--quiet', 'cython']' returned non-zero exit status 1.
#13 12.30 ----------------------------------------
#13 12.31 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
#13 ERROR: executor failed running [/bin/sh -c pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt]: exit code: 1
i've also tried to update certificates by adding:
RUN apt-get install ca-certificates -y
RUN update-ca-certificates
with no success. It could be important to know that i've also had the same issue with conda install section: RUN conda install pytorch==1.4.0 torchvision==0.5.0 cpuonly -c pytorch
and i've managed to find a workaround by disabling the certificate verification: RUN conda config --set ssl_verify false
What should i do? thank you!
I am trying create a new docker file, that uses existing docker file: rapidsai/rapidsai:22.04-cuda11.0-runtime-ubuntu18.04-py3.8
and install two new packages on the existing Conda environment.
What I tried:
FROM rapidsai/rapidsai:22.04-cuda11.0-runtime-ubuntu18.04-py3.8
RUN conda install -c conda-forge omegaconf hydra --quiet -y
output:
executor failed running [/bin/bash -c conda install -c conda-forge omegaconf hydra --quiet -y]: exit code: 1
Full error:
> [3/3] RUN conda install -c conda-forge omegaconf hydra --quiet -y:
#6 0.617 Collecting package metadata (current_repodata.json): ...working... done
#6 7.476 Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
#6 9.007 Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
#6 11.50 Collecting package metadata (repodata.json): ...working... done
#6 42.37 Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
#6 76.52 Found conflicts! Looking for incompatible packages.
#6 76.52 This can take several minutes. Press CTRL-C to abort.
#6 76.52 failed
#6 76.52
#6 76.52 UnsatisfiableError: The following specifications were found
#6 76.52 to be incompatible with the existing python installation in your environment:
#6 76.52
#6 76.52 Specifications:
#6 76.52
#6 76.52 - hydra -> python[version='3.6.*|3.7.*|3.8.*']
#6 76.52 - hydra -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0']
#6 76.52
#6 76.52 Your python: python=3.9
#6 76.52
#6 76.52 If python is on the left-most side of the chain, that's the version you've asked for.
#6 76.52 When python appears to the right, that indicates that the thing on the left is somehow
#6 76.52 not available for the python version you are constrained to. Note that conda will not
#6 76.52 change your python version to a different minor version unless you explicitly specify
#6 76.52 that.
#6 76.52
#6 76.52 The following specifications were found to be incompatible with each other:
#6 76.52
#6 76.52 Output in format: Requested package -> Available versions
#6 76.52
#6 76.52 Package pypy3.9 conflicts for:
#6 76.52 omegaconf -> python[version='>=3.9,<3.10.0a0'] -> pypy3.9[version='7.3.*|7.3.8.*|7.3.9.*']
#6 76.52 omegaconf -> pypy3.9[version='>=7.3.8|>=7.3.9']
#6 76.52
#6 76.52 Package _libgcc_mutex conflicts for:
#6 76.52 hydra -> libgcc-ng[version='>=9.3.0'] -> _libgcc_mutex[version='*|0.1',build='main|conda_forge']
#6 76.52 python=3.9 -> libgcc-ng[version='>=12'] -> _libgcc_mutex[version='*|0.1',build='main|conda_forge']
#6 76.52
#6 76.52 Package pypy3.7 conflicts for:
#6 76.52 omegaconf -> python[version='>=3.7,<3.8.0a0'] -> pypy3.7[version='7.3.*|7.3.3.*|7.3.4.*|7.3.5.*|7.3.7.*']
#6 76.52 omegaconf -> pypy3.7[version='>=7.3.3|>=7.3.5|>=7.3.7']
#6 76.52
#6 76.52 Package libsqlite conflicts for:
#6 76.52 omegaconf -> pypy3.9[version='>=7.3.9'] -> libsqlite[version='>=3.39.2,<4.0a0|>=3.39.4,<4.0a0']
#6 76.52 python=3.9 -> sqlite[version='>=3.38.5,<4.0a0'] -> libsqlite[version='3.39.2|3.39.3|3.39.4|>=3.39.4,<4.0a0|>=3.39.2,<4.0a0',build='h753d276_1|h753d276_0']
#6 76.52
#6 76.52 Package pypy3.6 conflicts for:
#6 76.52 hydra -> python[version='>=3.6,<3.7.0a0'] -> pypy3.6[version='7.3.0.*|7.3.1.*|7.3.2.*|7.3.3.*']
#6 76.52 omegaconf -> python[version='>=3.6,<3.7.0a0'] -> pypy3.6[version='7.3.*|7.3.0.*|7.3.1.*|7.3.2.*|7.3.3.*']
#6 76.52 omegaconf -> pypy3.6[version='>=7.3.1|>=7.3.2|>=7.3.3']
#6 76.52
#6 76.52 Package pypy3.8 conflicts for:
#6 76.52 omegaconf -> python[version='>=3.8,<3.9.0a0'] -> pypy3.8[version='7.3.*|7.3.8.*|7.3.9.*']
#6 76.52 omegaconf -> pypy3.8[version='>=7.3.8|>=7.3.9']
#6 76.52
------
executor failed running [/bin/bash -c conda install -c conda-forge omegaconf hydra --quiet -y]: exit code: 1
Thanks!
I have a Dockerfile and docker-compose.yml in my go project.
It is the contents of Dockerfile
FROM golang:1.7
RUN set -x; \
export DEBIAN_FRONTEND=noninteractive; \
echo "deb http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise main " >> /etc/apt/sources.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys FF160426C4832F92 \
&& apt-get update \
&& apt-get install -y \
libzmq1=4.0.4-bpa~precise1 \
libzmq-dev=4.0.4-bpa~precise1 \
pkg-config
ENV PATH /go/bin:$PATH
ENV GOPROJECTPATH /go/src/emitter
COPY . $GOPROJECTPATH
WORKDIR $GOPROJECTPATH
RUN go get -v
CMD ["bash"]
It is the docker-compose.yml
dev:
build: .
volumes:
- .:/go/src/emitter
working_dir: /go/src/emitter
command: bash
net: host
When I try building an image by running:
docker build --tag docker-task .
I have the below error in my terminal
[+] Building 4.3s (9/9) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/golang:1.7 1.5s
=> [1/5] FROM docker.io/library/golang:1.7#sha256:93b2b52f1212e97b6650bde1f20f6a359b08c117c57a848970d615fe88623a3d 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 277B 0.0s
=> CACHED [2/5] RUN set -x; export DEBIAN_FRONTEND=noninteractive; echo "deb http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise ma 0.0s
=> CACHED [3/5] COPY . /go/src/emitter 0.0s
=> CACHED [4/5] WORKDIR /go/src/emitter 0.0s
=> ERROR [5/5] RUN go get -v 2.8s
------
> [5/5] RUN go get -v:
#9 0.809 github.com/pebbe/zmq4 (download)
#9 2.680 github.com/pebbe/zmq4
#9 2.754 # github.com/pebbe/zmq4
#9 2.754 runtime: failed to create new OS thread (have 2 already; errno=22)
#9 2.754 fatal error: newosproc
#9 2.754
#9 2.754 runtime stack:
#9 2.754 runtime.throw(0x5ba65a, 0x9)
#9 2.754 /usr/local/go/src/runtime/panic.go:566 +0x95
#9 2.754 runtime.newosproc(0xc42002a000, 0xc420039fc0)
#9 2.754 /usr/local/go/src/runtime/os_linux.go:160 +0x194
#9 2.754 runtime.newm(0x5d6628, 0x0)
#9 2.754 /usr/local/go/src/runtime/proc.go:1572 +0x132
#9 2.754 runtime.main.func1()
#9 2.754 /usr/local/go/src/runtime/proc.go:126 +0x36
#9 2.754 runtime.systemstack(0x688400)
#9 2.754 /usr/local/go/src/runtime/asm_amd64.s:298 +0x79
#9 2.754 runtime.mstart()
#9 2.754 /usr/local/go/src/runtime/proc.go:1079
#9 2.754
#9 2.754 goroutine 1 [running]:
#9 2.754 runtime.systemstack_switch()
#9 2.754 /usr/local/go/src/runtime/asm_amd64.s:252 fp=0xc420024768 sp=0xc420024760
#9 2.754 runtime.main()
#9 2.754 /usr/local/go/src/runtime/proc.go:127 +0x6c fp=0xc4200247c0 sp=0xc420024768
#9 2.754 runtime.goexit()
#9 2.754 /usr/local/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc4200247c8 sp=0xc4200247c0
------
executor failed running [/bin/sh -c go get -v]: exit code: 2
So my question is what the error about, and how to pass the build.
many thanks
Is this the new MacBook with M1/M2 chip?
If yes, then:
Use this in Dockerfile: FROM --platform=linux/amd64 golang:1.7
OR
Set DOCKER_DEFAULT_PLATFORM=linux/amd64 enviromental variable
I want to use jupyter notbook by using Anaconda3 in docker ubuntu, but when I create an image with docker build --platform linux/amd64 . the following error occurs.
How can I solve it?
#8 141.1
#8 141.1 2022-05-05 04:21:55 (3.62 MB/s) - 'Anaconda3-2019.10-Linux-x86_64.sh' saved [530308481/530308481]
#8 141.1
#8 141.3 PREFIX=/opt/anaconda3
#8 143.4 Unpacking payload ...
[96] Failed to execute script entry_point concurrent.futures.process._RemoteTraceback:
#8 151.7 '''
#8 151.7 Traceback (most recent call last):
#8 151.7 File "concurrent/futures/process.py", line 367, in _queue_management_worker
#8 151.7 File "multiprocessing/connection.py", line 251, in recv
#8 151.7 TypeError: __init__() missing 1 required positional argument: 'msg'
#8 151.7 '''
#8 151.7
#8 151.7 The above exception was the direct cause of the following exception:
#8 151.7
#8 151.7 Traceback (most recent call last):
#8 151.7 File "entry_point.py", line 71, in <module>
#8 151.7 File "concurrent/futures/process.py", line 483, in _chain_from_iterable_of_lists
#8 151.7 File "concurrent/futures/_base.py", line 598, in result_iterator
#8 151.7 File "concurrent/futures/_base.py", line 435, in result
#8 151.7 File "concurrent/futures/_base.py", line 384, in __get_result
#8 151.7 concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
------ executor failed running [/bin/sh -c wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh && sh /opt/Anaconda3-2019.10-Linux-x86_64.sh -b -p /opt/anaconda3 && rm -f Anaconda3-2019.10-Linux-x86_64.sh]: exit code: 1
The Dockerfile is like below:
FROM ubuntu:latest
# update
RUN apt-get -y update && apt-get install -y \
sudo \
wget \
vim
#install anaconda3
WORKDIR /opt
# download anaconda package and install anaconda
# archive -> https://repo.continuum.io/archive/
RUN wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh && \
sh /opt/Anaconda3-2019.10-Linux-x86_64.sh -b -p /opt/anaconda3 && \
rm -f Anaconda3-2019.10-Linux-x86_64.sh
# set path
ENV PATH /opt/anaconda3/bin:$PATH
# update pip and conda
RUN pip install --upgrade pip
WORKDIR /
RUN mkdir /work
# execute jupyterlab as a default command
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root", "--LabApp.token=''"]
Mac 12.3.1 Apple M1
Docker desktop for Mac 4.7.1
It can be a space issue during the installation, I was getting the exact error. If you accept the default option to install Anaconda on the “default path” Anaconda is installed in your user home directory, where space can be an issue. For me it got resolved when changed the default directory to some other directory during installation .You can also refer this page for similar issues- https://github.com/conda/conda/issues/10143
Context
I have a jenkins that builds a docker image for a raspberry pi 2.
It is using buildx to emulate the ArmV7 environment during build.
This worked great until recently I got random errors during installing the apk packages.
Dockerfile
FROM python:3-alpine
# picam python module
ARG PICAMERA_RELEASE_ADDRESS="{private_repo}"
# Ardafruit python module
ARG ARDAFRUIT_RELEASE_URL="{private_repo}"
WORKDIR /tmp
ENV LD_LIBRARY_PATH="/opt/vc/lib"
COPY ./files /app
RUN apk add --no-cache --verbose \
raspberrypi-libs \
bluez \
bluez-deprecated \
unzip \
git \
glib-dev \
gobject-introspection-dev \
cairo-dev \
py3-cairo \
openssl-dev \
nano \
bash \
alpine-sdk \
&& git clone ${PICAMERA_RELEASE_ADDRESS} \
&& cd picamera \
&& su -c "python3 setup.py install" \
&& cd /tmp/ \
&& git clone ${ARDAFRUIT_RELEASE_URL} \
&& cd Adafruit_Python_DHT \
&& su -c "python3 setup.py install --force-pi2" \
&& cd /tmp/ \
&& CFLAGS="-fcommon" pip3 install \
btlewrap==0.0.* \
Flask==2.* \
waitress==2.* \
flask-cors==3.* \
miflora==0.* \
colorzero==2.* \
RPi.GPIO==0.7.* \
&& cd /tmp/ \
&& chmod +x /app/main.py \
&& chmod +x /app/healthcheck.py \
&& chmod +x /app/harden.sh \
&& apk del \
unzip \
git \
glib-dev \
gobject-introspection-dev \
cairo-dev \
py3-cairo \
openssl-dev \
nano \
bash \
alpine-sdk \
libc-utils \
&& rm -rf /tmp/* \
&& sh /app/harden.sh \
&& rm -f /app/harden.sh \
&& rm -f /bin/rm
# finalize
WORKDIR /app
EXPOSE 80
ENTRYPOINT [ "python3" ]
CMD [ "/app/main.py" ]
HEALTHCHECK --interval=1m --timeout=10s \
CMD python3 /app/healthcheck.py
Pipeline for the build
pipeline {
environment {
registryCredential = ''
registryURL = ''
scmURL = ''
scmCredential = ''
dockerImage = ''
working_branch = ''
working_dir = ''
}
agent any
stages {
stage('Cloning Git') {
steps {
git(
url: scmURL,
credentialsId: scmCredential,
branch: working_branch
)
}
}
stage('docker login') {
steps {
sh '$(aws ecr get-login --no-include-email --region eu-central-1)'
}
}
stage('Build Image and push it') {
steps{
dir(working_dir){
sh "docker build -t $registryURL:latest --platform linux/arm/v7 --push ."
}
}
}
}
}
Jenkins Output
#7 [3/5] COPY ./files /app
#7 DONE 0.0s
#8 [4/5] RUN apk fix && apk add --no-cache --verbose raspberrypi-libs bluez bluez-deprecated unzip git glib-dev gobject-introspection-dev cairo-dev py3-cairo openssl-dev nano bash alpine-sdk && apk fix && git clone https://{private_repo} && cd picamera && su -c "python3 setup.py install" && cd /tmp/ && git clone https://{private_repo} && cd Adafruit_Python_DHT && su -c "python3 setup.py install --force-pi2" && cd /tmp/ && CFLAGS="-fcommon" pip3 install btlewrap==0.0.* Flask==2.* waitress==2.* flask-cors==3.* miflora==0.* colorzero==2.* RPi.GPIO==0.7.* && cd /tmp/ && chmod +x /app/main.py && chmod +x /app/healthcheck.py && chmod +x /app/harden.sh && apk del unzip git glib-dev gobject-introspection-dev cairo-dev py3-cairo openssl-dev nano bash alpine-sdk libc-utils && rm -rf /tmp/* && sh /app/harden.sh && rm -f /app/harden.sh && rm -f /bin/rm
#8 0.337 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/armv7/APKINDEX.tar.gz
#8 1.611 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/armv7/APKINDEX.tar.gz
#8 3.302 OK: 11 MiB in 37 packages
#8 3.581 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/armv7/APKINDEX.tar.gz
#8 4.617 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/armv7/APKINDEX.tar.gz
#8 6.349 (1/130) Installing fakeroot (1.25.3-r3)
#8 6.382 (2/130) Installing openssl (1.1.1l-r0)
#8 6.465 (3/130) Installing libattr (2.5.1-r0)
#8 6.487 (4/130) Installing attr (2.5.1-r0)
#8 6.517 (5/130) Installing libacl (2.2.53-r0)
#8 6.540 (6/130) Installing tar (1.34-r0)
#8 6.632 (7/130) Installing pkgconf (1.7.4-r0)
#8 6.667 (8/130) Installing patch (2.7.6-r7)
#8 6.715 (9/130) Installing libstdc++ (10.3.1_git20210424-r2)
#8 6.894 (10/130) Installing lzip (1.22-r0)
#8 6.929 (11/130) Installing brotli-libs (1.0.9-r5)
#8 7.062 (12/130) Installing nghttp2-libs (1.43.0-r0)
#8 7.101 (13/130) Installing libcurl (7.79.1-r0)
#8 7.185 (14/130) Installing curl (7.79.1-r0)
#8 7.244 (15/130) Installing abuild (3.8.0_rc4-r0)
#8 7.285 Executing abuild-3.8.0_rc4-r0.pre-install
#8 7.296 ERROR: abuild-3.8.0_rc4-r0.pre-install: script exited with error 1
#8 7.321 (16/130) Installing binutils (2.35.2-r2)
#8 7.910 (17/130) Installing libmagic (5.40-r1)
#8 8.140 (18/130) Installing file (5.40-r1)
#8 8.162 (19/130) Installing libgomp (10.3.1_git20210424-r2)
#8 8.226 (20/130) Installing libatomic (10.3.1_git20210424-r2)
#8 8.249 (21/130) Installing libgphobos (10.3.1_git20210424-r2)
#8 8.735 (22/130) Installing gmp (6.2.1-r0)
#8 8.805 (23/130) Installing isl22 (0.22-r0)
#8 8.991 (24/130) Installing mpfr4 (4.1.0-r0)
#8 9.056 (25/130) Installing mpc1 (1.2.1-r0)
#8 9.093 (26/130) Installing gcc (10.3.1_git20210424-r2)
#8 13.99 (27/130) Installing musl-dev (1.2.2-r3)
#8 14.57 (28/130) Installing libc-dev (0.7.2-r3)
#8 14.59 (29/130) Installing g++ (10.3.1_git20210424-r2)
#8 18.44 (30/130) Installing make (4.3-r0)
#8 18.48 (31/130) Installing fortify-headers (1.1-r1)
#8 18.50 (32/130) Installing build-base (0.5-r2)
#8 18.51 (33/130) Installing pcre2 (10.36-r0)
#8 18.58 (34/130) Installing git (2.32.0-r0)
#8 19.63 (35/130) Installing alpine-sdk (1.0-r1)
#8 19.65 (36/130) Installing bash (5.1.4-r0)
#8 19.80 Executing bash-5.1.4-r0.post-install
#8 19.82 ERROR: bash-5.1.4-r0.post-install: script exited with error 1
#8 19.82 (37/130) Installing dbus-libs (1.12.20-r2)
#8 19.88 (38/130) Installing dbus (1.12.20-r2)
#8 19.93 Executing dbus-1.12.20-r2.pre-install
#8 19.94 ERROR: dbus-1.12.20-r2.pre-install: script exited with error 1
#8 19.96 Executing dbus-1.12.20-r2.post-install
#8 19.97 ERROR: dbus-1.12.20-r2.post-install: script exited with error 1
#8 19.97 (39/130) Installing libblkid (2.37.2-r0)
#8 20.04 (40/130) Installing libmount (2.37.2-r0)
#8 20.09 (41/130) Installing pcre (8.44-r0)
#8 20.15 (42/130) Installing glib (2.68.3-r0)
#8 20.46 (43/130) Installing json-c (0.15-r1)
#8 20.52 (44/130) Installing eudev-libs (3.2.10-r0)
#8 20.59 (45/130) Installing bluez (5.58-r2)
#8 20.91 (46/130) Installing bluez-deprecated (5.58-r2)
#8 21.06 (47/130) Installing libxau (1.0.9-r0)
#8 21.08 (48/130) Installing libmd (1.0.3-r0)
#8 21.11 (49/130) Installing libbsd (0.11.3-r0)
#8 21.14 (50/130) Installing libxdmcp (1.1.3-r0)
#8 21.16 (51/130) Installing libxcb (1.14-r2)
#8 21.27 (52/130) Installing libx11 (1.7.2-r0)
#8 21.57 (53/130) Installing libxrender (0.9.10-r3)
#8 21.59 (54/130) Installing libxext (1.3.4-r0)
#8 21.61 (55/130) Installing libpng (1.6.37-r1)
#8 21.65 (56/130) Installing freetype (2.10.4-r1)
#8 21.76 (57/130) Installing fontconfig (2.13.1-r4)
#8 21.86 (58/130) Installing pixman (0.40.0-r2)
#8 21.94 (59/130) Installing cairo (1.16.0-r3)
#8 22.10 (60/130) Installing cairo-tools (1.16.0-r3)
#8 22.20 (61/130) Installing expat-dev (2.4.1-r0)
#8 22.23 (62/130) Installing brotli-dev (1.0.9-r5)
#8 22.26 (63/130) Installing zlib-dev (1.2.11-r3)
#8 22.30 (64/130) Installing libpng-dev (1.6.37-r1)
#8 22.34 (65/130) Installing freetype-dev (2.10.4-r1)
#8 22.46 (66/130) Installing blkid (2.37.2-r0)
#8 22.50 (67/130) Installing libcap-ng (0.8.2-r0)
#8 22.52 (68/130) Installing setpriv (2.37.2-r0)
#8 22.55 (69/130) Installing libsmartcols (2.37.2-r0)
#8 22.60 (70/130) Installing findmnt (2.37.2-r0)
#8 22.64 (71/130) Installing mcookie (2.37.2-r0)
#8 22.67 (72/130) Installing hexdump (2.37.2-r0)
#8 22.70 (73/130) Installing lsblk (2.37.2-r0)
#8 22.75 (74/130) Installing libfdisk (2.37.2-r0)
#8 22.84 (75/130) Installing sfdisk (2.37.2-r0)
#8 22.87 (76/130) Installing cfdisk (2.37.2-r0)
#8 22.91 (77/130) Installing partx (2.37.2-r0)
#8 22.95 (78/130) Installing flock (2.37.2-r0)
#8 22.97 (79/130) Installing logger (2.37.2-r0)
#8 23.00 (80/130) Installing uuidgen (2.37.2-r0)
#8 23.02 (81/130) Installing libeconf (0.3.8-r1)
#8 23.04 (82/130) Installing util-linux (2.37.2-r0)
#8 23.37 (83/130) Installing util-linux-dev (2.37.2-r0)
#8 23.57 (84/130) Installing fontconfig-dev (2.13.1-r4)
#8 23.60 (85/130) Installing xorgproto (2021.4-r0)
#8 23.82 (86/130) Installing libxau-dev (1.0.9-r0)
#8 23.85 (87/130) Installing xcb-proto (1.14.1-r2)
#8 23.91 (88/130) Installing libxdmcp-dev (1.1.3-r0)
#8 23.93 (89/130) Installing libxcb-dev (1.14-r2)
#8 24.08 (90/130) Installing xtrans (1.4.0-r1)
#8 24.13 (91/130) Installing libx11-dev (1.7.2-r0)
#8 24.18 (92/130) Installing libxext-dev (1.3.4-r0)
#8 24.22 (93/130) Installing libxrender-dev (0.9.10-r3)
#8 24.25 (94/130) Installing pixman-dev (0.40.0-r2)
#8 24.27 (95/130) Installing util-macros (1.19.3-r0)
#8 24.30 (96/130) Installing xcb-util (0.4.0-r3)
#8 24.32 (97/130) Installing xcb-util-dev (0.4.0-r3)
#8 24.35 (98/130) Installing cairo-gobject (1.16.0-r3)
#8 24.38 (99/130) Installing mpdecimal (2.5.1-r1)
#8 24.42 (100/130) Installing python3 (3.9.5-r1)
#8 28.02 (101/130) Installing gettext-asprintf (0.21-r0)
#8 28.04 (102/130) Installing libunistring (0.9.10-r1)
#8 28.25 (103/130) Installing gettext-libs (0.21-r0)
#8 28.39 (104/130) Installing libxml2 (2.9.12-r1)
#8 28.57 (105/130) Installing gettext (0.21-r0)
#8 28.70 (106/130) Installing gettext-dev (0.21-r0)
#8 28.95 (107/130) Installing bzip2-dev (1.0.8-r1)
#8 28.97 (108/130) Installing libxml2-utils (2.9.12-r1)
#8 29.00 (109/130) Installing libgpg-error (1.42-r0)
#8 29.07 (110/130) Installing libgcrypt (1.9.4-r0)
#8 29.22 (111/130) Installing libxslt (1.1.34-r1)
#8 29.28 (112/130) Installing docbook-xml (4.5-r6)
#8 29.47 Executing docbook-xml-4.5-r6.post-install
#8 29.47 ERROR: docbook-xml-4.5-r6.post-install: script exited with error 1
#8 29.48 (113/130) Installing docbook-xsl (1.79.2-r2)
#8 30.38 Executing docbook-xsl-1.79.2-r2.post-install
#8 30.39 (114/130) Installing linux-headers (5.10.41-r0)
#8 30.39 ERROR: docbook-xsl-1.79.2-r2.post-install: script exited with error 1
#8 31.04 (115/130) Installing libffi-dev (3.3-r2)
#8 31.09 (116/130) Installing libpcre16 (8.44-r0)
#8 31.14 (117/130) Installing libpcre32 (8.44-r0)
#8 31.19 (118/130) Installing libpcrecpp (8.44-r0)
#8 31.22 (119/130) Installing pcre-dev (8.44-r0)
#8 31.40 (120/130) Installing glib-dev (2.68.3-r0)
#8 31.68 (121/130) Installing cairo-dev (1.16.0-r3)
#8 31.72 (122/130) Installing libltdl (2.4.6-r7)
#8 31.76 (123/130) Installing libtool (2.4.6-r7)
#8 31.99 (124/130) Installing gobject-introspection (1.68.0-r1)
#8 32.10 (125/130) Installing gobject-introspection-dev (1.68.0-r1)
#8 32.61 (126/130) Installing nano (5.7-r2)
#8 32.68 (127/130) Installing openssl-dev (1.1.1l-r0)
#8 32.84 (128/130) Installing py3-cairo (1.20.1-r0)
#8 32.87 (129/130) Installing raspberrypi-libs (0.20200813-r0)
#8 33.12 (130/130) Installing unzip (6.0-r9)
#8 33.19 Executing busybox-1.33.1-r6.trigger
#8 33.33 Executing dbus-1.12.20-r2.trigger
#8 33.48 Executing glib-2.68.3-r0.trigger
#8 33.66 No schema files found: doing nothing.
#8 33.75 5 errors; 167 packages, 603 dirs, 10399 files, 282 MiB
#8 ERROR: process "/dev/.buildkit_qemu_emulator /bin/sh -c apk fix && apk add --no-cache --verbose raspberrypi-libs \t\tbluez bluez-deprecated \t\tunzip git \t\tglib-dev \t\tgobject-introspection-dev \t\tcairo-dev \t\tpy3-cairo \t\topenssl-dev \t\tnano bash alpine-sdk && apk fix && git clone ${PICAMERA_RELEASE_ADDRESS} && cd picamera && su -c \"python3 setup.py install\" && cd /tmp/ && git clone ${ARDAFRUIT_RELEASE_URL} && cd Adafruit_Python_DHT && su -c \"python3 setup.py install --force-pi2\" && cd /tmp/ && CFLAGS=\"-fcommon\" pip3 install btlewrap==0.0.* Flask==2.* waitress==2.* flask-cors==3.* miflora==0.* colorzero==2.* RPi.GPIO==0.7.* && cd /tmp/ && chmod +x /app/main.py && chmod +x /app/healthcheck.py && chmod +x /app/harden.sh && apk del \t\tunzip git \t\tglib-dev \t\tgobject-introspection-dev \t\tcairo-dev \t\tpy3-cairo \t\topenssl-dev \t\tnano bash alpine-sdk libc-utils && rm -rf /tmp/* && sh /app/harden.sh && rm -f /app/harden.sh && rm -f /bin/rm" did not complete successfully: exit code: 5
As you can see there are errors while installing abuild, bash, dbus, docbook-xml and docbook-xsl but these errors are not consistent, on the run before it were only docbook-xsl (the only consistent error) in the run after, abuild and dbus installed successfully.
I am not sure what causes the problem, or how to get more information about the error.
Running the build directly on the raspberry pi works of course, so it seems the error is located somewhere in the multi-arch configuration, but I am not sure what could have changed.
ok, looks like i found my solution here:
https://gitlab.alpinelinux.org/alpine/aports/-/issues/12406
quote from Lyle Franklin:
I hit this error when trying to build a cross-platform ARM64 docker
image from a AMD64 host. However, running docker run --rm --privileged linuxkit/binfmt:v0.8 or update-binfmts --enable prior to running the build seems to avoid the issue. My understanding Docker
will try to use upstream QEMU if it is installed and registered with
the kernel, otherwise Docker will fallback to using a built-in forked
version of QEMU. The build error above only showed up for me with the
forked QEMU.
So I will probably add docker run --rm --privileged linuxkit/binfmt:v0.8 && update-binfmts --enable to my pipeline file if I encounter the error again, for now running it once solved the issue.