docker build failed in mac - docker

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

Related

Can't build docker image (requirements.txt install pymssql error)

I want to up flask app with a container on AWS App Runner but when I creating Docker Images I getting error. In requirements.txt file pymssql library importing error.
Here is requirements.txt file:
flask
jsonify
pandas
pymssql
numpy
jwt
Here is Dockerfile:
FROM python:3.10
COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
COPY . /app
EXPOSE 8081
CMD ["python", "app.py" ]
When building Docker images I getting this error
#8 12.28
#8 12.28 × Building wheel for pymssql (pyproject.toml) did not run successfully.
#8 12.28 │ exit code: 1
#8 12.28 ╰─> [25 lines of output]
#8 12.28 setup.py: platform.system() => Linux
#8 12.28 setup.py: platform.architecture() => ('64bit', 'ELF')
#8 12.28 setup.py: platform.libc_ver() => ('glibc', '2.31')
#8 12.28 setup.py: include_dirs => []
#8 12.28 setup.py: library_dirs => []
#8 12.28 running bdist_wheel
#8 12.28 running build
#8 12.28 running build_py
#8 12.28 creating build
#8 12.28 creating build/lib.linux-aarch64-cpython-310
#8 12.28 creating build/lib.linux-aarch64-cpython-310/pymssql
#8 12.28 copying src/pymssql/__init__.py -> build/lib.linux-aarch64-cpython-310/pymssql
#8 12.28 running build_ext
#8 12.28 cythoning src/pymssql/_mssql.pyx to src/pymssql/_mssql.c
#8 12.28 cythoning src/pymssql/_pymssql.pyx to src/pymssql/_pymssql.c
#8 12.28 building 'pymssql._mssql' extension
#8 12.28 creating build/temp.linux-aarch64-cpython-310
#8 12.28 creating build/temp.linux-aarch64-cpython-310/src
#8 12.28 creating build/temp.linux-aarch64-cpython-310/src/pymssql
#8 12.28 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.10 -c src/pymssql/_mssql.c -o build/temp.linux-aarch64-cpython-310/src/pymssql/_mssql.o -DMSDBLIB
#8 12.28 src/pymssql/_mssql.c:747:10: fatal error: sqlfront.h: No such file or directory
#8 12.28 747 | #include "sqlfront.h"
#8 12.28 | ^~~~~~~~~~~~
#8 12.28 compilation terminated.
#8 12.28 error: command '/usr/bin/gcc' failed with exit code 1
#8 12.28 [end of output]
#8 12.28
#8 12.28 note: This error originates from a subprocess, and is likely not a problem with pip.
#8 12.28 ERROR: Failed building wheel for pymssql
#8 12.28 Successfully built jsonify
#8 12.28 Failed to build pymssql
#8 12.28 ERROR: Could not build wheels for pymssql, which is required to install pyproject.toml-based projects
#8 12.28
#8 12.28 [notice] A new release of pip available: 22.2.2 -> 22.3.1
#8 12.28 [notice] To update, run: pip install --upgrade pip
------
executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code:

Issue with `multiarch-support` is not installable when building Docker image

My Dockerfile
FROM continuumio/miniconda3
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends g++ unixodbc-dev
# Copy environment.yml (if found) to a temp location so we update the environment.
COPY environment.yml /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp
RUN apt install -y gnupg curl
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17
# optional: for bcp and sqlcmd
RUN ACCEPT_EULA=Y apt-get install -y mssql-tools
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
RUN . ~/.bashrc
# optional: for unixODBC development headers
RUN apt-get install -y unixodbc-dev
WORKDIR /workspace
COPY . .
ENTRYPOINT ["/bin/bash"]
When I am trying to build the docker image using docker build -t my-simulator . I am getting the followings:
=> [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 1.09kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 34B 0.0s => [internal] load metadata for docker.io/continuumio/miniconda3:latest 1.1s => [auth] continuumio/miniconda3:pull token for registry-1.docker.io 0.0s => [internal] load build context 0.0s => => transferring context: 11.16kB 0.0s => [ 1/15] FROM docker.io/continuumio/miniconda3#sha256:977263e8d1e476972fddab1c75fe050dd3cd17626390e874448bd92721fd659b 0.0s => CACHED [ 2/15] RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get -y install --no-install-recommends g++ unixodbc-dev 0.0s => CACHED [ 3/15] COPY environment.yml /tmp/conda-tmp/ 0.0s => CACHED [ 4/15] RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi && rm -rf /tmp/conda- 0.0s => CACHED [ 5/15] RUN apt install -y gnupg curl 0.0s => CACHED [ 6/15] RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 0.0s => CACHED [ 7/15] RUN curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list 0.0s => CACHED [ 8/15] RUN apt-get update 0.0s => ERROR [ 9/15] RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17 0.8s ------
> [ 9/15] RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17:
#14 0.313 Reading package lists...
#14 0.651 Building dependency tree...
#14 0.736 Reading state information...
#14 0.771 Some packages could not be installed. This may mean that you have
#14 0.771 requested an impossible situation or if you are using the unstable
#14 0.771 distribution that some required packages have not yet been created
#14 0.771 or been moved out of Incoming.
#14 0.771 The following information may help to resolve the situation:
#14 0.771
#14 0.771 The following packages have unmet dependencies:
#14 0.810 libodbc1 : PreDepends: multiarch-support but it is not installable
#14 0.810 odbcinst1debian2 : PreDepends: multiarch-support but it is not installable
#14 0.817 E: Unable to correct problems, you have held broken packages.
------
executor failed running [/bin/sh -c ACCEPT_EULA=Y apt-get install -y msodbcsql17]: exit code: 100
It seems the issue is multiarch-suppot being not installable. I have tried these solutions (#1 and #2) without success.

ERROR RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-auto-ssl

I am trying to run docker-compose build to build a container but for some reason its not building
I am on wsl2 ubuntu
This is the Dockerfile.dev
FROM openresty/openresty:1.19.3.2-3-alpine-fat
RUN apk update
RUN apk upgrade
RUN apk add openssl gettext
ENV PYTHONUNBUFFERED=1
# RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN apk add python3
RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-auto-ssl
RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-http
RUN openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj '/CN=sni-support-required-for-valid-ssl' -keyout /etc/ssl/resty-auto-ssl-fallback.key -out /etc/ssl/resty-auto-ssl-fallback.crt
#
#
#
ADD ./config/dev.nginx.conf /nginx.conf
#
#
#
ADD ./pre-start.sh /pre-start.sh
RUN chmod +x /pre-start.sh
RUN mkdir /var/log/nginx
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80
EXPOSE 443
ENTRYPOINT ["/pre-start.sh"]
CMD ["nginx", "-g", "daemon off;"]
and this is my docker-compose.yml
version: "3"
services:
nginx:
build:
context: .
dockerfile: ./Dockerfile.dev
image: nginx
container_name: nginx
env_file: .env
ports:
- "80:80"
Whenever I run docker-compose build I get this is error message
[+] Building 16.1s (10/17)
=> [internal] load build definition from Dockerfile.dev 0.0s
=> => transferring dockerfile: 953B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/openresty/openresty:1.19.3.2-3-alpine-fat 2.2s
=> [internal] load build context 0.0s
=> => transferring context: 4.30kB 0.0s
=> [ 1/13] FROM docker.io/openresty/openresty:1.19.3.2-3-alpine-fat#sha256:efee64d92b55d76535f97aea190f5702c50564c2cc1a9ca6b3642c0 0.0s
=> CACHED [ 2/13] RUN apk update 0.0s
=> CACHED [ 3/13] RUN apk upgrade 0.0s
=> CACHED [ 4/13] RUN apk add openssl gettext 0.0s
=> CACHED [ 5/13] RUN apk add python3 0.0s
=> ERROR [ 6/13] RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-auto-ssl 13.7s
------
> [ 6/13] RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-auto-ssl:
#0 2.446 Installing https://luarocks.org/lua-resty-auto-ssl-0.13.1-1.src.rock
#0 4.028 Missing dependencies for lua-resty-auto-ssl 0.13.1-1:
#0 4.028 lua-resty-http (not installed)
#0 4.028 shell-games >= 1.1.0 (not installed)
#0 4.028
#0 4.028 lua-resty-auto-ssl 0.13.1-1 depends on lua-resty-http (not installed)
#0 4.028 Installing https://luarocks.org/lua-resty-http-0.17.0.beta.1-0.src.rock
#0 5.562
#0 5.562 lua-resty-http 0.17.0.beta.1-0 depends on lua >= 5.1 (5.1-1 provided by VM)
#0 5.663 No existing manifest. Attempting to rebuild...
#0 5.704 lua-resty-http 0.17.0.beta.1-0 is now installed in /usr/local/openresty/luajit (license: 2-clause BSD)
#0 5.704
#0 5.704 lua-resty-auto-ssl 0.13.1-1 depends on shell-games >= 1.1.0 (not installed)
#0 5.704 Installing https://luarocks.org/shell-games-1.1.0-1.src.rock
#0 7.055
#0 7.121 Warning: unmatched variable LUA_LIBDIR
#0 7.136 mkdir -p /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build
#0 7.138 rm -f /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/stamp-dehydrated-*
#0 7.140 mkdir -p /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/bin
#0 7.141 curl -sSLo /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/bin/dehydrated "https://raw.githubusercontent.com/lukas2511/dehydrated/05eda91a2fbaed1e13c733230238fc68475c535e/dehydrated"
#0 7.585 chmod +x /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/bin/dehydrated
#0 7.586 touch /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/stamp-dehydrated-2-05eda91a2fbaed1e13c733230238fc68475c535e
#0 7.587 rm -f /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/stamp-lua-resty-shell-*
#0 7.588 curl -sSLo /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/lib/resty/auto-ssl/vendor/shell.lua "https://raw.githubusercontent.com/juce/lua-resty-shell/955243d70506c21e7cc29f61d745d1a8a718994f/lib/resty/shell.lua"
#0 8.188 touch /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/stamp-lua-resty-shell-955243d70506c21e7cc29f61d745d1a8a718994f
#0 8.189 rm -f /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/stamp-sockproc-*
#0 8.191 mkdir -p /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/bin
#0 8.191 cd /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build && curl -sSLo sockproc-92aba736027bb5d96e190b71555857ac5bb6b2be.tar.gz "https://github.com/juce/sockproc/archive/92aba736027bb5d96e190b71555857ac5bb6b2be.tar.gz"
#0 13.64 curl: (6) Could not resolve host: codeload.github.com
#0 13.64 make: *** [Makefile:81: /tmp/luarocks_lua-resty-auto-ssl-0.13.1-1-jlAcah/lua-resty-auto-ssl/build/stamp-sockproc-2-92aba736027bb5d96e190b71555857ac5bb6b2be] Error 6
#0 13.64
#0 13.64 Error: Build error: Failed building.
#0 13.66 shell-games 1.1.0-1 is now installed in /usr/local/openresty/luajit (license: MIT)
#0 13.66
------
failed to solve: executor failed running [/bin/sh -c /usr/local/openresty/luajit/bin/luarocks install lua-resty-auto-ssl]: exit code: 1
I am new to docker so I have no idea on what more information I should provide. Please let me know the solution or if there is anymore information I have to provide

Cannot Download google-chrome-stable on M1 Mac

I am getting an error when I try to run docker build the following Dockerfile on an M1 Mac.
My full Docker file is:
FROM maven:3.6.3-openjdk-15
#Chrome
ARG CHROME_VERSION=98.0.4758.102-1
ADD google-chrome.repo /etc/yum.repos.d/google-chrome.repo
RUN microdnf install -y google-chrome-stable-$CHROME_VERSION \
&& sed -i 's/"$HERE\/chrome"/"$HERE\/chrome" --no-sandbox/g' /opt/google/chrome/google-chrome
## ChromeDriver
ARG CHROME_DRIVER_VERSION=98.0.4758.102
RUN microdnf install -y unzip \
&& curl -s -o /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
&& unzip /tmp/chromedriver.zip -d /opt \
&& rm /tmp/chromedriver.zip \
&& mv /opt/chromedriver /opt/chromedriver-$CHROME_DRIVER_VERSION \
&& chmod 755 /opt/chromedriver-$CHROME_DRIVER_VERSION \
&& ln -s /opt/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver
ENV CHROMEDRIVER_PORT 4444
ENV CHROMEDRIVER_WHITELISTED_IPS "127.0.0.1"
ENV CHROMEDRIVER_URL_BASE ''
EXPOSE 4444
EXPOSE 8080
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar", "-Xmx600m","/app.jar"]
The error I get is regarding google-chrome-stable, specifically package google-chrome-stable-98.0.4758.102-1.x86_64 does not have a compatible architecture. The full error is:
docker build -t monolith-repo .
[+] Building 12.0s (7/9)
=> [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/maven:3.6.3-openjdk-15 0.3s
=> [internal] load build context 0.0s
=> => transferring context: 122B 0.0s
=> [1/5] FROM docker.io/library/maven:3.6.3-openjdk-15#sha256:aac64d9d716f5fa3926e6c8f43c680fa8404faae0b8a014c0c9b3d73d2d0f66a 0.0s
=> CACHED [2/5] ADD google-chrome.repo /etc/yum.repos.d/google-chrome.repo 0.0s
=> ERROR [3/5] RUN microdnf install -y google-chrome-stable-98.0.4758.102-1 && sed -i 's/"$HERE\/chrome"/"$HERE\/chrome" --no-sandbox/g' /opt/google/chrome/google-chrome 11.6s
------
> [3/5] RUN microdnf install -y google-chrome-stable-98.0.4758.102-1 && sed -i 's/"$HERE\/chrome"/"$HERE\/chrome" --no-sandbox/g' /opt/google/chrome/google-chrome:
#7 0.232 Downloading metadata...
#7 5.286 Downloading metadata...
#7 9.705 Downloading metadata...
#7 11.53 error: Could not depsolve transaction; 1 problem detected:
#7 11.53 Problem: conflicting requests
#7 11.53 - package google-chrome-stable-98.0.4758.102-1.x86_64 does not have a compatible architecture
#7 11.53 - nothing provides libm.so.6(GLIBC_2.2.5)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides ld-linux-x86-64.so.2(GLIBC_2.2.5)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides libpthread.so.0(GLIBC_2.2.5)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides libdl.so.2(GLIBC_2.2.5)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides librt.so.1(GLIBC_2.2.5)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides libpthread.so.0(GLIBC_2.3.2)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides libpthread.so.0(GLIBC_2.12)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides libpthread.so.0(GLIBC_2.3.4)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides ld-linux-x86-64.so.2(GLIBC_2.3)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides ld-linux-x86-64.so.2()(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
#7 11.53 - nothing provides libpthread.so.0(GLIBC_2.3.3)(64bit) needed by google-chrome-stable-98.0.4758.102-1.x86_64
------
executor failed running [/bin/sh -c microdnf install -y google-chrome-stable-$CHROME_VERSION && sed -i 's/"$HERE\/chrome"/"$HERE\/chrome" --no-sandbox/g' /opt/google/chrome/google-chrome]: exit code: 1
Does anyone know how to fix this? Do I have to download a different version of google-chrome-stable? Or do I need to use a different approach?
There are a few key issues occurring:
Per https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable is (currently) only for linux/amd (not arm) architecture. When it says package google-chrome-stable-98.0.4758.102-1.x86_64 does not have a compatible architecture, note the x86_64indicates it is linux amd (not arm). So The issue is that there is no image for it to pull.

Docker Can't Find Install.sh

I created a folder in Windows that has a Dockerfile and an install.sh script. When I attempt to build the docker image, I get an error that says:
=> ERROR [4/4] RUN /install.sh 0.6s
------
> [4/4] RUN /install.sh:
#7 0.584 /bin/sh: 1: /install.sh: not found
This is my Dockerfile:
FROM ubuntu:latest
ADD install.sh /
RUN chmod u+x /install.sh
RUN /install.sh
ENV PATH /root/miniconda3/bin:$PATH
This is my install.sh:
#!/bin/bash
apt-get update
apt-get upgrade -y
apt-get install -y bzip2 gcc git ping htop screen vim wget
apt-get clean
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O Miniconda.sh
bash Miniconda.sh -b
rm -rf Miniconda.sh
export PATH="/root/miniconda3/bin:$PATH"
conda install -y pandas
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
CMD ["/bin/zsh"]
This is what I am running in Windows to produce the error:
docker build -t app_test:v1.01 .
output:
[+] Building 1.3s (8/8) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 158B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:latest 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 490B 0.0s
=> CACHED [1/4] FROM docker.io/library/ubuntu:latest 0.0s
=> [2/4] ADD install.sh / 0.0s
=> [3/4] RUN chmod u+x /install.sh 0.5s
=> ERROR [4/4] RUN /install.sh 0.6s
------
> [4/4] RUN /install.sh:
#7 0.584 /bin/sh: 1: /install.sh: not found
------
executor failed running [/bin/sh -c /install.sh]: exit code: 127
So far I've tried the following:
renaming the install.sh file to something else
Changing the ADD line to COPY so that the line says COPY install.sh /install.sh
googling the issue to see anyone else has experienced something
similar.
EDIT #1:
tree and ls output:
PS C:\Users\Rick\Documents\experiments> tree
Folder PATH listing
Volume serial number is D49A-7235
C:.
No subfolders exist
PS C:\Users\Rick\Documents\experiments> ls
Directory: C:\Users\Rick\Documents\experiments
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 11/21/2021 11:11 AM 132 Dockerfile
-a--- 11/21/2021 9:05 AM 451 install.sh
EDIT #2 adding RUN ls / to Dockerfile:
[+] Building 2.0s (9/9) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 181B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:latest 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 32B 0.0s
=> [1/5] FROM docker.io/library/ubuntu:latest 0.0s
=> CACHED [2/5] COPY install.sh /install.sh 0.0s
=> [3/5] RUN ls / 0.5s
=> [4/5] RUN chmod u+x /install.sh 0.6s
=> ERROR [5/5] RUN /install.sh 0.7s
------
> [5/5] RUN /install.sh:
#9 0.694 /bin/sh: 1: /install.sh: not found
------
executor failed running [/bin/sh -c /install.sh]: exit code: 127
The cause of the issue was saving the install.sh file using Windows line endings. It needed to be saved using Unix line endings. In Visual Studio Code, change the "CRLF" button to "LF".

Resources