docker cannot build image mac - docker

My mac is Apple M1
Content in my dockerfile:
FROM --platform=linux/amd64 golang:1.18
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"]
but once I run build image command:
docker build --tag docker-emitter-org .
I have this error in my terminal
[+] Building 52.9s (6/9)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 606B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/golang:1.18 1.8s
=> [1/5] FROM docker.io/library/golang:1.18#sha256:040bc0980888e2df09499c73156f3f869d843b7033d11b465fee7f1a358a494a 33.6s
=> => resolve docker.io/library/golang:1.18#sha256:040bc0980888e2df09499c73156f3f869d843b7033d11b465fee7f1a358a494a 0.0s
=> => sha256:040bc0980888e2df09499c73156f3f869d843b7033d11b465fee7f1a358a494a 2.36kB / 2.36kB 0.0s
=> => sha256:23858da423a6737f0467fab0014e5b53009ea7405d575636af0c3f100bbb2f10 55.03MB / 55.03MB 8.4s
=> => sha256:a42821cd14fb31c4aa253203e7f8e34fc3b15d69ce370f1223fbbe4252a64202 10.88MB / 10.88MB 5.3s
=> => sha256:ebd59a91af0c61cf28a22a9651ffd45612848bdcc1a43c2c3063825ba2e613fc 1.80kB / 1.80kB 0.0s
=> => sha256:f81bafb819d5b520ab919b42e5925c4b32b62241fc1d036036d9bb5aa2f522d1 7.10kB / 7.10kB 0.0s
=> => sha256:326f452ade5c33097eba4ba88a24bd77a93a3d994d4dc39b936482655e664857 5.16MB / 5.16MB 3.1s
=> => sha256:8471b75885efc7790a16be5328e3b368567b76a60fc3feabd6869c15e175ee05 54.58MB / 54.58MB 16.2s
=> => sha256:b7aa120dd02d9fa75bb50861103f7837514028ea6f06e3e821b8c47c2c10d386 85.96MB / 85.96MB 23.0s
=> => extracting sha256:23858da423a6737f0467fab0014e5b53009ea7405d575636af0c3f100bbb2f10 1.6s
=> => sha256:5cc67fe6144b8a2d33963edb62297bdaa3f968746061866b48db3f3125e68734 141.88MB / 141.88MB 29.3s
=> => extracting sha256:326f452ade5c33097eba4ba88a24bd77a93a3d994d4dc39b936482655e664857 0.1s
=> => extracting sha256:a42821cd14fb31c4aa253203e7f8e34fc3b15d69ce370f1223fbbe4252a64202 0.2s
=> => extracting sha256:8471b75885efc7790a16be5328e3b368567b76a60fc3feabd6869c15e175ee05 1.7s
=> => sha256:cd3416ecab879296d41843948ae859cadb4bd4300a60b23abef443645845ab4a 156B / 156B 16.4s
=> => extracting sha256:b7aa120dd02d9fa75bb50861103f7837514028ea6f06e3e821b8c47c2c10d386 2.2s
=> => extracting sha256:5cc67fe6144b8a2d33963edb62297bdaa3f968746061866b48db3f3125e68734 3.8s
=> => extracting sha256:cd3416ecab879296d41843948ae859cadb4bd4300a60b23abef443645845ab4a 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 876B 0.0s
=> ERROR [2/5] RUN set -x; export DEBIAN_FRONTEND=noninteractive; echo "deb http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise main " >> / 17.5s
------
> [2/5] 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:
#4 0.202 + export DEBIAN_FRONTEND=noninteractive
#4 0.207 + echo deb http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise main
#4 0.208 + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys FF160426C4832F92
#4 0.897 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
#4 1.397 Executing: /tmp/apt-key-gpghome.aCEKfc6dIj/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys FF160426C4832F92
#4 1.841 gpg: key FF160426C4832F92: public key "Launchpad PPA for Bertrand Paquet" imported
#4 1.879 gpg: Total number processed: 1
#4 1.879 gpg: imported: 1
#4 5.851 + apt-get update
#4 6.159 Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
#4 6.193 Ign:2 http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise InRelease
#4 6.251 Get:3 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
#4 6.251 Get:4 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
#4 6.264 Get:5 http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise Release [11.9 kB]
#4 6.354 Get:6 http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise Release.gpg [316 B]
#4 7.634 Get:7 http://deb.debian.org/debian bullseye/main amd64 Packages [8184 kB]
#4 9.254 Get:8 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [184 kB]
#4 10.32 Get:9 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [2596 B]
#4 11.57 Ign:6 http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise Release.gpg
#4 14.66 Reading package lists...
#4 16.99 W: GPG error: http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise Release: The following signatures were invalid: E9F21DF686E307024F2EE2B7FF160426C4832F92
#4 16.99 E: The repository 'http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise Release' is not signed.
------
executor failed running [/bin/sh -c 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]: exit code: 100
it says
GPG error: http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu
precise Release: The following signatures were invalid:
E9F21DF686E307024F2EE2B7FF160426C4832F92
#4 16.99 E: The repository 'http://ppa.launchpad.net/bpaquet/zeromq4-precise/ubuntu precise
Release' is not signed.
I really do not know what it mean and wondering how to fix and pass the build.
thanks

Related

Error building docker image for a simple rust application: extra-runtime-dependencies package not found?

Anyone try building a rust image using the directions on docker hub? https://hub.docker.com/_/rust
FROM rust:1.40 as builder
WORKDIR /usr/src/myapp
COPY . .
RUN cargo install --path .
FROM debian:buster-slim
RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/myapp /usr/local/bin/myapp
CMD ["myapp"]
When I tried to build it using docker build -t myapp, I got an error:
=> CACHED [stage-1 1/3] FROM docker.io/library/debian:buster-slim#sha256:5dbce817ee72802025a38a388237b0ea576aa16 0.0s
=> ERROR [stage-1 2/3] RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/ap 5.4s
------
> [stage-1 2/3] RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*:
#6 0.617 Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
#6 0.698 Get:2 http://deb.debian.org/debian-security buster/updates InRelease [34.8 kB]
#6 0.731 Get:3 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
#6 0.875 Get:4 http://deb.debian.org/debian buster/main amd64 Packages [7909 kB]
#6 1.700 Get:5 http://deb.debian.org/debian-security buster/updates/main amd64 Packages [397 kB]
#6 1.734 Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]
#6 2.708 Fetched 8529 kB in 2s (3802 kB/s)
#6 2.708 Reading package lists...
#6 3.432 Reading package lists...
#6 4.230 Building dependency tree...
#6 4.443 Reading state information...
#6 4.571 E: Unable to locate package extra-runtime-dependencies
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*]: exit code: 100
The rust documentation needs clarification on this, but extra-runtime-dependencies is a placeholder. Explanation is here

Dockerfile error: The repository 'http://dl.google.com/linux/chrome/deb stable InRelease' is not signed

This dockerfile works when line 4 (case 1) is uncommented, but fails when line 5 (case 2) is uncommented. I have very puzzled by this. The error (if I understand it) should happen in both cases. See the error trace below.
Dockerfile - Case 1 works, case 2 fails
# This is an auto generated Dockerfile for ros:ros-core
# generated from docker_images/create_ros_core_image.Dockerfile.em
# Case 1: Works FROM ubuntu:focal
# Case 2: Gives error FROM dorowu/ubuntu-desktop-lxde-vnc:focal
# setup timezone
RUN apt-get update && \
apt-get install -q -y --no-install-recommends tzdata && \
rm -rf /var/lib/apt/lists/*
# install packages
RUN apt-get update && apt-get install -q -y --no-install-recommends \
dirmngr \
gnupg2 \
&& rm -rf /var/lib/apt/lists/*
# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list
# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV ROS_DISTRO noetic
# install ros packages
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-noetic-ros-core=1.5.0-1* \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ros-noetic-desktop-full
Error Trace
+] Building 0.9s (6/11)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.21kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal 0.5s
=> [auth] dorowu/ubuntu-desktop-lxde-vnc:pull token for registry-1.docker.io 0.0s
=> CACHED [1/7] FROM docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal#sha256:07e51eafb 0.0s
=> ERROR [2/7] RUN echo 'Etc/UTC' > /etc/timezone && ln -s /usr/share/zoneinfo/E 0.3s
------
> [2/7] RUN echo 'Etc/UTC' > /etc/timezone && ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && apt-get update && apt-get install -q -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*:
#6 0.307 ln: failed to create symbolic link '/etc/localtime': File exists
------
executor failed running [/bin/sh -c echo 'Etc/UTC' > /etc/timezone && ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && apt-get update && apt-get install -q -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*]: exit code: 1
~/mydev/dockerplay docker build -t dockerplay3 .
[+] Building 18.5s (5/10)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.11kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal 0.2s
=> CACHED [1/7] FROM docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal#sha256:07e51eafb 0.0s
=> ERROR [2/7] RUN apt-get update && apt-get install -q -y --no-install-recomme 18.2s
------
> [2/7] RUN apt-get update && apt-get install -q -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*:
#5 1.045 Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
#5 1.046 Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
#5 1.136 Get:3 http://mirrors.ubuntu.com/mirrors.txt Mirrorlist [3393 B]
#5 1.498 Get:4 http://ubuntu.mirror.frontiernet.net/ubuntu focal InRelease [265 kB]
#5 1.612 Ign:6 https://atl.mirrors.clouvider.net/ubuntu focal-backports InRelease
#5 1.651 Get:5 http://mirrors.xmission.com/ubuntu focal-updates InRelease [114 kB]
#5 1.817 Get:6 http://mirrors.gigenet.com/ubuntuarchive focal-backports InRelease [108 kB]
#5 2.547 Err:1 http://dl.google.com/linux/chrome/deb stable InRelease
#5 2.547 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
#5 3.783 Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2031 kB]
#5 4.116 Get:8 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [27.5 kB]
#5 4.120 Get:9 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [883 kB]
#5 4.229 Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1398 kB]
#5 5.734 Get:13 http://mirror.team-cymru.com/ubuntu focal/universe amd64 Packages [11.3 MB]
#5 5.738 Get:11 http://mirror.uoregon.edu/ubuntu focal/restricted amd64 Packages [33.4 kB]
#5 5.772 Get:14 http://mirrors.arpnetworks.com/Ubuntu focal/multiverse amd64 Packages [177 kB]
#5 5.881 Ign:12 https://mirror.us.leaseweb.net/ubuntu focal/main amd64 Packages
#5 6.256 Get:12 http://mirror.metrocast.net/ubuntu focal/main amd64 Packages [1275 kB]
#5 6.749 Ign:15 http://ftp.usf.edu/pub/ubuntu focal-updates/restricted amd64 Packages
#5 6.837 Ign:15 http://mirrors.arpnetworks.com/Ubuntu focal-updates/restricted amd64 Packages
#5 6.967 Get:17 http://mirrors.namecheap.com/ubuntu focal-updates/universe amd64 Packages [1161 kB]
#5 7.214 Ign:16 https://mirrors.ocf.berkeley.edu/ubuntu-ports focal-updates/multiverse amd64 Packages
#5 7.575 Ign:15 https://mirrors.tscak.com/ubuntu focal-updates/restricted amd64 Packages
#5 8.978 Get:18 http://www.gtlib.gatech.edu/pub/ubuntu focal-updates/main amd64 Packages [2479 kB]
#5 9.766 Get:16 http://repo.miserver.it.umich.edu/ubuntu focal-updates/multiverse amd64 Packages [30.2 kB]
#5 9.927 Get:15 http://mirror.us-ny2.kamatera.com/ubuntu focal-updates/restricted amd64 Packages [1511 kB]
#5 10.24 Get:19 http://reflector.westga.edu/repos/Ubuntu/archive focal-backports/main amd64 Packages [54.2 kB]
#5 10.49 Ign:20 http://mirror.enzu.com/ubuntu focal-backports/universe amd64 Packages
#5 10.85 Ign:20 https://ubuntu.mirror.shastacoe.net/ubuntu focal-backports/universe amd64 Packages
#5 11.07 Ign:20 https://mirrors.ocf.berkeley.edu/ubuntu-ports focal-backports/universe amd64 Packages
#5 11.24 Get:20 http://mirror.umd.edu/ubuntu focal-backports/universe amd64 Packages [27.1 kB]
#5 13.98 Reading package lists...
#5 18.18 W: GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
#5 18.18 E: The repository 'http://dl.google.com/linux/chrome/deb stable InRelease' is not signed.
------
executor failed running [/bin/sh -c apt-get update && apt-get install -q -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*]: exit code: 100
I believe the public keys for the mentioned repository changed recently, or something like that. Quick fix:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
Then try again.
I haven't solver this. But I made it go away by removing the lines totally and adding these instead (which I got from another Dockerfile):
RUN apt-get install -y wget
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install ./google-chrome-stable_current_amd64.deb

Docker ERROR when RUN apt update && apt install -y python3 [duplicate]

This question already exists:
Docker Error when RUN apt install -y python3
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
I am trying to build a new image "first" with a docker file. However, it throws an error with the second line of docker file when I try to build the image.
This is my docker file:
FROM ubuntu:18.10
RUN apt update && apt install -y python3
This is the error message I get:
C:\Users\82104\Desktop\ExerciseFiles>docker build -t first .
[+] Building 2.0s (5/5) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 98B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:18.10 0.0s
=> CACHED [1/2] FROM docker.io/library/ubuntu:18.10 0.0s
=> ERROR [2/2] RUN apt update && apt install -y python3 1.8s
------
> [2/2] RUN apt update && apt install -y python3:
#5 0.539
#5 0.539 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#5 0.539
#5 0.948 Ign:1 http://archive.ubuntu.com/ubuntu cosmic InRelease
#5 0.948 Ign:2 http://security.ubuntu.com/ubuntu cosmic-security InRelease
#5 1.100 Ign:3 http://archive.ubuntu.com/ubuntu cosmic-updates InRelease
#5 1.100 Err:4 http://security.ubuntu.com/ubuntu cosmic-security Release
#5 1.100 404 Not Found [IP: 91.189.88.152 80]
#5 1.252 Ign:5 http://archive.ubuntu.com/ubuntu cosmic-backports InRelease
#5 1.397 Err:6 http://archive.ubuntu.com/ubuntu cosmic Release
#5 1.397 404 Not Found [IP: 91.189.88.142 80]
#5 1.552 Err:7 http://archive.ubuntu.com/ubuntu cosmic-updates Release
#5 1.552 404 Not Found [IP: 91.189.88.142 80]
#5 1.703 Err:8 http://archive.ubuntu.com/ubuntu cosmic-backports Release
#5 1.703 404 Not Found [IP: 91.189.88.142 80]
#5 1.715 Reading package lists...
#5 1.736 E: The repository 'http://security.ubuntu.com/ubuntu cosmic-security Release' does not have a Release file.
#5 1.736 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic Release' does not have a Release file.
#5 1.736 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-updates Release' does not have a Release file.
#5 1.736 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-backports Release' does not have a Release file.
------
executor failed running [/bin/sh -c apt update && apt install -y python3]: exit code: 100
Thanks for your help!

Laravel Sail Failed to Build

I'm struggling to get Laravel Sail working. Following the instructions from the documentation I'm not really understanding why the container is failing to build. I don't have any docker experience.
./vendor/bin/sail php -v
returns "Cannot load Xdebug - it was already loaded"
./vendor/bin/sail build --no-cache fails who what reason?
Sorry if not much to go on, anyone who could point me in the right direction would be much appreciated.
wazimshizm#Surface-Pro-6:~/code/sports$ ./vendor/bin/sail php -v
Cannot load Xdebug - it was already loaded
PHP 8.0.7 (cli) (built: Jun 4 2021 21:26:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies
with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
wazimshizm#Surface-Pro-6:~/code/sports$ ./vendor/bin/sail build --no-cache
mysql uses an image, skipping
redis uses an image, skipping
meilisearch uses an image, skipping
mailhog uses an image, skipping
selenium uses an image, skipping
Building laravel.test
[+] Building 64.7s (8/16)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 2.42kB 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 906B 0.0s
=> [ 1/12] FROM docker.io/library/ubuntu:20.04 0.0s
=> CACHED [ 2/12] WORKDIR /var/www/html 0.0s
=> [ 3/12] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone 0.5s
=> ERROR [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unz 64.0s
------
> [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*:
#7 1.140 Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
#7 1.546 Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
#7 3.365 Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
#7 4.008 Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
#7 4.747 Get:5 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
#7 4.889 Get:6 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
#7 5.676 Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
#7 11.34 Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
#7 63.42 Reading package lists...
#7 63.94 E: Release file for http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease is not valid yet (invalid for another 5h 15min 5s). Updates for this repository will not be applied.
#7 63.94 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 5h 15min 24s). Updates for this repository will not be applied.
#7 63.94 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease is not valid yet (invalid for another 5h 15min 54s). Updates for this repository will not be applied.
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
ERROR: Service 'laravel.test' failed to build : Build failed
wazimshizm#Surface-Pro-6:~/code/sports$ ./vendor/bin/sail build --no-cache
mysql uses an image, skipping
redis uses an image, skipping
meilisearch uses an image, skipping
mailhog uses an image, skipping
selenium uses an image, skipping
Building laravel.test
[+] Building 64.5s (8/16)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 38B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 0.0s
=> [ 1/12] FROM docker.io/library/ubuntu:20.04 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 99B 0.0s
=> CACHED [ 2/12] WORKDIR /var/www/html 0.0s
=> [ 3/12] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone 0.5s
=> ERROR [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unz 63.8s
------
> [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*:
#7 1.142 Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
#7 1.219 Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
#7 3.044 Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
#7 3.684 Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
#7 4.414 Get:5 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
#7 56.13 Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
#7 61.75 Get:7 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
#7 62.16 Get:8 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
#7 63.17 Reading package lists...
#7 63.76 E: Release file for http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease is not valid yet (invalid for another 5h 12min 49s). Updates for this repository will not be applied.
#7 63.76 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 5h 13min 7s). Updates for this repository will not be applied.
#7 63.76 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease is not valid yet (invalid for another 5h 13min 38s). Updates for this repository will not be applied.
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.0-cli php8.0-dev php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-curl php8.0-memcached php8.0-imap php8.0-mysql php8.0-mbstring php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap php8.0-intl php8.0-readline php8.0-msgpack php8.0-igbinary php8.0-ldap php8.0-redis && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
ERROR: Service 'laravel.test' failed to build : Build failed
build:
context: ./vendor/laravel/sail/runtimes/8.0
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.0/app
Change 8.1 to ...runtimes/8.0 and and sail-8.0 , then try sail up

How to install yq on Docker image python:3?

What I want to do
I want to install yq to edit some yaml files on a Docker container.
Dockerfile
FROM python:3
RUN apt-get update
RUN apt-key adv --keyserver keyserver.ubuntu.com --keyserver-option http-proxy=http://xxxxxx.com:9999 --recv-keys CC86BB64
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:rmescandon/yq
RUN apt update
RUN apt install yq -y
Reference
https://github.com/mikefarah/yq#on-ubuntu-1604-or-higher-from-debian-package
Build Logs
=> => transferring dockerfile: 486B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3 0.0s
=> CACHED [1/7] FROM docker.io/library/python:3 0.0s
=> [2/7] RUN apt-get update 2.7s
=> [3/7] RUN apt-key adv --keyserver keyserver.ubuntu.com --keyserver-option http-proxy=http://xxxxxx.com:9999 --recv-keys CC86BB64 1.2s
=> [4/7] RUN apt-get install -y software-properties-common 11.4s
=> [5/7] RUN add-apt-repository ppa:rmescandon/yq 13.3s
=> ERROR [6/7] RUN apt update 1.8s
------
> [6/7] RUN apt update:
#9 0.159
#9 0.159 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#9 0.159
#9 0.205 Hit:1 http://deb.debian.org/debian buster InRelease
#9 0.205 Hit:2 http://security.debian.org/debian-security buster/updates InRelease
#9 0.227 Hit:3 http://deb.debian.org/debian buster-updates InRelease
#9 0.870 Ign:4 http://ppa.launchpad.net/rmescandon/yq/ubuntu impish InRelease
#9 1.356 Err:5 http://ppa.launchpad.net/rmescandon/yq/ubuntu impish Release
#9 1.356 404 Not Found [IP: 91.189.95.85 80]
#9 1.381 Reading package lists...
#9 1.752 E: The repository 'http://ppa.launchpad.net/rmescandon/yq/ubuntu impish Release' does not have a Release file.
------
executor failed running [/bin/sh -c apt update]: exit code: 100
Question
How can I fix it?
TL;DR
The PPA for yq is not available on the python:3 image's Linux distribution.
Change your Dockerfile to download the binary directly instead:
FROM python:3
RUN apt-get update
RUN apt-get install -y wget
# Latest on https://launchpad.net/~rmescandon/+archive/ubuntu/yq is 4.9.6
ARG VERSION=v4.9.6
ARG BINARY=yq_linux_386
RUN wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq \
&& chmod +x /usr/bin/yq
Explanation
The mentioned instructions for installing yq are expecting an Ubuntu-based image, but the python:3 Docker image is based on Debian 10 / Buster (as of the writing of this answer):
Dockerfile for python:3 = python:3.9 = python:3.9.6:
FROM buildpack-deps:buster
$ docker run -it python:3 bash
root#fa97b25dc0d3:/# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root#fa97b25dc0d3:/#
The error
E: The repository 'http://ppa.launchpad.net/rmescandon/yq/ubuntu impish Release' does not have a Release file.
means that the package ppa:rmescandon/yq does not support your distribution. You can check the supports distributions from http://ppa.launchpad.net/rmescandon/yq/ubuntu:
The workaround is to just install it from source or to just download the yq binary itself. This is supported by yq: https://github.com/mikefarah/yq#wget:
wget
Use wget to download the pre-compiled binaries:
Compressed via tar.gz
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - | tar xz && mv ${BINARY} /usr/bin/yq
Plain binary
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq && chmod +x /usr/bin/yq
For instance, VERSION=v4.2.0 and BINARY=yq_linux_amd64
Pick out a specific release from yq's Releases page (preferably matching one of the versions distributed for Ubuntu same as in the PPA) and modify your Dockerfile to:
FROM python:3
RUN apt-get update
RUN apt-get install -y wget
# Latest on https://launchpad.net/~rmescandon/+archive/ubuntu/yq is 4.9.6
ARG VERSION=v4.9.6
ARG BINARY=yq_linux_386
RUN wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq \
&& chmod +x /usr/bin/yq
Previous answer did not work in my case.
So this is my alternative solution:
Download the latest executable file of yq from GitHub:
RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
Set execute permission for file:
RUN chmod a+x /usr/local/bin/yq
You can also get the yq in an image using,
FROM docker.io/mikefarah/yq:4.30.6 as yq
FROM python:3
COPY --from=yq "/usr/bin/yq" "/usr/local/bin/yq"
...

Resources