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
Related
I want ot build a Docker image with the following features:
Must have a Debian 11 base image (Mandatory)
On top of it, I also need installed:
Python 3.
spaCy package (There could be others of my choice).
Google Cloud SDK (I will need this to run commands using gcloud and gsutil).
Most likely, I will download some files stored in some Cloud Storage bucket.
I decided to use gcr.io/cloud-marketplace/google/debian11:latest because as far as I understood, that base image should have both Python and Google Cloud SDK already installed on top of it, but it did not, so I started adding what I needed on my own.
My first Dockerfile attempt (defaults) looks as follows:
FROM gcr.io/cloud-marketplace/google/debian11:latest
RUN apt-get update -y
# Suggested by #JohnHanley, in the comments section
RUN apt-get install apt-transport-https ca-certificates gnupg -y
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update -y && \
apt-get install google-cloud-cli -y
# Back to my original implementation
RUN apt-get install -y python3
RUN apt-get install -y python3-pip
RUN pip install spacy==3.2.1
CMD ["gsutil","--version"]
The error triggered:
------
> [4/6] RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-cli -y:
#6 0.403 deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main
#6 0.403 /bin/sh: 1: curl: not found
#6 0.442 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
#6 0.453 gpg: no valid OpenPGP data found.
------
executor failed running [/bin/sh -c echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-cli -y]: exit code: 2
My second Dockerfile attempt ("If apt-key command is not supported") looks as follows:
FROM gcr.io/cloud-marketplace/google/debian11:latest
RUN apt-get update -y
# Suggested by #JohnHanley, in the comments section
RUN apt-get install apt-transport-https ca-certificates gnupg -y
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | tee /usr/share/keyrings/cloud.google.gpg && apt-get update -y && \
apt-get install google-cloud-sdk -y
# Back to my original implementation
RUN apt-get install -y python3
RUN apt-get install -y python3-pip
RUN pip install spacy==3.2.1
CMD ["gsutil","--version"]
The error triggered:
------
> [4/6] RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | tee /usr/share/keyrings/cloud.google.gpg && apt-get update -y && apt-get install google-cloud-sdk -y:
#7 0.423 deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main
#7 0.423 /bin/sh: 1: curl: not found
#7 0.974 Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
#7 1.130 Get:2 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
#7 1.215 Get:3 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
#7 1.373 Get:4 http://packages.cloud.google.com/apt cloud-sdk InRelease [6751 B]
#7 1.420 Err:4 http://packages.cloud.google.com/apt cloud-sdk InRelease
#7 1.420 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05 NO_PUBKEY FEEA9169307EA071
#7 1.431 Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [262 kB]
#7 1.590 Reading package lists...
#7 1.985 W: GPG error: http://packages.cloud.google.com/apt cloud-sdk InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05 NO_PUBKEY FEEA9169307EA071
#7 1.985 E: The repository 'http://packages.cloud.google.com/apt cloud-sdk InRelease' is not signed.
------
executor failed running [/bin/sh -c echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | tee /usr/share/keyrings/cloud.google.gpg && apt-get update -y && apt-get install google-cloud-sdk -y]: exit code: 100
If the section where Google Cloud SDK is installed gets commented, the rest works OK. Another important info:
The base OS:
Edition Windows 10 Pro
Version 22H2
Installed on 10/27/2022
OS build 19045.2251
Experience Windows Feature Experience Pack 120.2212.4180.0
Docker version: Docker version 20.10.21, build baeda1f
QUESTIONS:
What am I doing wrong?
Is there a better way to do what I want? (Image size can have up to 10GB in size, so optimization might be optional for this case).
UPDATES:
This section will include lengthy answers to questions raised in the comment sections.
2022-12-02, #JohnHanley suggested in thew comments, to follow Google official documentation (section "Docker Tip") to write the Dockerfiles, which I was already doing, but did not include in the original post; I am including that now. OS and Dockerfile versions are included also.
You can install gcloud cli in your container with the following way :
FROM gcr.io/cloud-marketplace/google/debian11:latest
RUN apt-get update -y
RUN apt install curl -y
ENV PATH=/google-cloud-sdk/bin:$PATH
WORKDIR /
RUN export CLOUD_SDK_VERSION="410.0.0" && \
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
ln -s /lib /lib64
RUN gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true && \
gcloud config set metrics/environment github_docker_images && \
gcloud -q components install beta kubectl
ENTRYPOINT [ "sh", "-c", "gcloud --version" ]
This part is not mandatory :
RUN gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true && \
gcloud config set metrics/environment github_docker_images && \
gcloud -q components install beta kubectl
I just wonder I have seen a few similar questions and trying different solutions such us adding the list of sources into the sources.list file and removing/pruning images using docker commands but doesn't seem to work.
I am just building a new image and the code is like:
&& echo "I am here ------------------->>" \
&& apt-get update \
&& apt-get install -y apt-utils \
&& apt-get install -y build-essential \
&& apt-get autoremove -y \
&& apt-get upgrade -y \
&& apt-get install -y wget unzip \
&& rm -rf /var/lib/apt/lists/* \
&& echo "------------------->>" \
&& cd /tmp \
&& wget --quiet --directory-prefix=/tmp https://releases.hashicorp.com/vault/0.10.1/vault_0.10.1_linux_amd64.zip \
&& unzip vault*.zip \
but keep on getting the error below. Btw I am running on a mac.
Required [IP: 10.139.234.224 8080]
#16 0.426 E: Failed to fetch http://httpredir.debian.org/debian/dists/buster-backports/InRelease 407 Proxy Authentication Required [IP: 10.139.234.224 8080]
#16 0.426 E: The repository 'http://httpredir.debian.org/debian buster-backports InRelease' is not signed.
#16 0.426 E: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease 407 Proxy Authentication Required [IP: 10.139.234.224 8080]
#16 0.426 E: The repository 'http://deb.debian.org/debian bullseye-updates InRelease' is not signed.
E: The repository 'http://deb.debian.org/debian bullseye-updates InRelease' is not signed.
I'm struggling to get build my project after updating my Docker.
My previous working DockerFile:
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
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 php7.4-cli php7.4-dev \
php7.4-pgsql php7.4-sqlite3 php7.4-gd \
php7.4-curl php7.4-memcached \
php7.4-imap php7.4-mysql php7.4-mbstring \
php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap \
php7.4-intl php7.4-readline php7.4-pcov \
php7.4-msgpack php7.4-igbinary php7.4-ldap \
php7.4-redis \
&& php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \
&& curl -sL https://deb.nodesource.com/setup_15.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/*
With the Platform: platform: linux/x86_64 in my Docker-Compose.
However, it now isn't working after updating Docker and I'm clueless why.
Returns the response now of:
After this operation, 116 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_15.x focal/main arm64 nodejs
arm64 15.14.0-deb-1nodesource1 [24.8 MB] debconf: delaying package
configuration, since apt-utils is not installed Fetched 24.8 MB in 2s
(12.5 MB/s) Selecting previously unselected package nodejs. (Reading
database ... 21576 files and directories currently installed.)
Preparing to unpack .../nodejs_15.14.0-deb-1nodesource1_arm64.deb ...
Unpacking nodejs (15.14.0-deb-1nodesource1) ... Setting up nodejs
(15.14.0-deb-1nodesource1) ... Processing triggers for man-db
(2.9.1-1) ... Warning: apt-key output should not be parsed (stdout is
not a terminal) gpg: no valid OpenPGP data found. Segmentation fault 1
error occurred:
* Status: The command '/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 php7.4-cli php7.4-dev php7.4-pgsql
php7.4-sqlite3 php7.4-gd php7.4-curl php7.4-memcached
php7.4-imap php7.4-mysql php7.4-mbstring php7.4-xml php7.4-zip
php7.4-bcmath php7.4-soap php7.4-intl php7.4-readline
php7.4-pcov php7.4-msgpack php7.4-igbinary php7.4-ldap
php7.4-redis && php -r
"readfile('http://getcomposer.org/installer');" | php --
--install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_15.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/*'
returned a non-zero code: 2, Code: 2
Steps tried (Specifying Ubuntu version in case there's some incompatibilities):
FROM --platform=linux/arm64/v8 ubuntu:18.04
Error 1: Unable to locate package python2
FROM --platform=linux/arm64/v8 ubuntu:21.04
Error 1: The following packages have unmet dependencies: libxml2 :
Depends: libicu66 (>= 66.1-1~) but it is not installable php7.4-intl
: Depends: libicu66 (>= 66.1-1~) but it is not installable
Error 2: Unable to correct problems, you have held broken packages. 1
error occurred: Status: The command '/bin/sh -c [....] returned a
non-zero code: 100, Code: 100
FROM --platform=linux/arm64/v8 ubuntu:22.04
Error 1: The following packages have unmet dependencies: libxml2 :
Depends: libicu66 (>= 66.1-1~) but it is not installable php7.4-intl
: Depends: libicu66 (>= 66.1-1~) but it is not installable
Error 2: Unable to correct problems, you have held broken packages. 1
error occurred: Status: The command '/bin/sh -c [....] returned a
non-zero code: 100, Code: 100
Docker-Compose:
I have specified my platform to now be platform: linux/amd64rather than platform: linux/x86_64 as per to the docs. Tried using linux/arm64 but that didn't work either (Same errors produced).
Fixed it, I was being an idiot yesterday night.
Solution A: (In my case): Downgrade back to Docker Desktop version 4.0.0. I was using Intel Images so that's why I had to specify x86_64.
A more better solution would to change all my images be Arm64 and Intel based as well as it being compatible with Ubuntu + Mysql (currently docker Is recommending to use MariaDB for now)
However - seeing that Docker is still relatively unstable and can stop your build process at any moment, I advise anyone to update the Docker for M1 with caution!
I am not able to run the following command in the dockerfile.
RUN apt-get update && \
apt-get -y install curl && \
curl http://nginx.org/keys/nginx_signing.key | apt-key add - && \
apt-get update && \
apt-get -y install build-essential libpq-dev nginx supervisor && \
rm -rf /var/lib/apt/lists/*
I get an error like this...
Err:5 http://nginx.org/packages/debian jessie InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
Reading package lists...
W: GPG error: http://nginx.org/packages/debian jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
E: The repository 'http://nginx.org/packages/debian jessie InRelease' is not signed.
The command '/bin/sh -c apt-get update && apt-get -y install curl && curl http://nginx.org/keys/nginx_signing.key | apt-key add - && apt-get update && apt-get -y install build-essential libpq-dev nginx supervisor && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
I need to build the docker image in order to run the compose file that I found here...
https://github.com/yoanisgil/easygeoip
use this instead
FROM python:2.7-slim
RUN apt-get update && \
apt-get -y install wget gnupg && \
wget https://nginx.org/keys/nginx_signing.key && \
cat nginx_signing.key | apt-key add - && \
apt-get update && \
apt-get -y install build-essential libpq-dev nginx supervisor && \
rm -rf /var/lib/apt/lists/*
I think your curl did not produced the correct file
I have trouble with using dockerfile to build image.
dockerfile:
FROM node:4.4
MAINTAINER paas
ENV NGINX_VERSION 1.11.6-1~jessie
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
&& echo "deb nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
nginx=${NGINX_VERSION} \
nginx-module-xslt \
nginx-module-geoip \
nginx-module-image-filter \
nginx-module-perl \
nginx-module-njs \
gettext-base \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /etc/nginx/sites-enabled
# SSL Certificate Installation
ADD star_dar_kz.key /etc/ssl/
# ADD star_dar_kz.pem /etc/ssl/
# ADD dhparam.pem /etc/ssl/
# ADD nginx.conf /etc/nginx/
# ADD merchants.dar.kz.conf /etc/nginx/sites-enabled
COPY . /app
WORKDIR /app
RUN npm install --global gulp-cli
RUN npm install --global bower
RUN npm install
RUN bower --allow-root install
RUN gulp build --env prod
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
And after docker build, the GPG line appears as red and image creation fails. Why?
Sending build context to Docker daemon 3.072kB
Step 1/16 : FROM node:4.4
---> 93b396996a16
Step 2/16 : MAINTAINER Nurbek Sadykov
---> Using cache
---> e9a0bc967863
Step 3/16 : ENV NGINX_VERSION 1.11.6-1~jessie
---> Using cache
---> 3e87467bd365
Step 4/16 : RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 && echo "deb h:/nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list && apt-get update && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates nginx=${NGINX_VERSION} nginx-module-xslt nginx-module-geoip nginx-module-image-filter nginx-module-perl nginx-module-njs gettext-base curl && rm -rf /var/lib/apt/lists/*
---> Running in 93f88784bc24
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.acoVZ86x3m --no-auto-check-trustdb --trust-model always --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
**gpg: requesting key 7BD9BF62 from hkp server pgp.mit.edu**
**gpg: key 7BD9BF62: public key "nginx signing key " imported**
**gpg: Total number processed: 1**
**gpg: imported: 1 (RSA: 1)** - ** THIS IS INDICATED IN RED COLOR**
Get:1 url InRelease [63.1 kB]
Get:2 url InRelease [2865 B]
Ign url jessie InRelease
Get:3 url jessie-updates InRelease [145 kB]
Get:4 url amd64 Packages [37.3 kB]
Get:5 url jessie Release.gpg [2373 B]
Get:6 urljessie Release [148 kB]
Get:7 url amd64 Packages [613 kB]
Get:8 url amd64 Packages [23.2 kB]
Get:9 url jessie/main amd64 Packages [9063 kB]
Fetched 10.1 MB in 5s (1835 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
**Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming**.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nginx-module-geoip : Depends: nginx (= 1.13.7-1~jessie)
nginx-module-image-filter : Depends: nginx (= 1.13.7-1~jessie)
nginx-module-njs : Depends: nginx (= 1.13.7-1~jessie)
nginx-module-perl : Depends: nginx (= 1.13.7-1~jessie)
nginx-module-xslt : Depends: nginx (= 1.13.7-1~jessie)
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 && echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list && apt-get update && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates nginx=${NGINX_VERSION} nginx-module-xslt nginx-module-geoip nginx-module-image-filter nginx-module-perl nginx-module-njs gettext-base curl && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
There were three issues in your Dockerfile:
Incorrect url to nginx packages
Nginx modules should be the same version as nginx
There is no version 1.11.6-1~jessie for module nginx-module-njs, so we need to add one more ENV variable.
The final Dockerfile is:
FROM node:4.4
MAINTAINER paas
ENV NGINX_VERSION 1.11.6-1~jessie
ENV NGINX_MODULE_NJS 1.11.6.0.1.4-2~jessie
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
&& echo 'deb http://nginx.org/packages/mainline/debian/ jessie nginx' >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
nginx=${NGINX_VERSION} \
nginx-module-xslt=${NGINX_VERSION} \
nginx-module-geoip=${NGINX_VERSION} \
nginx-module-image-filter=${NGINX_VERSION} \
nginx-module-perl=${NGINX_VERSION} \
nginx-module-njs=${NGINX_MODULE_NJS} \
gettext-base \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /etc/nginx/sites-enabled
# SSL Certificate Installation
ADD star_dar_kz.key /etc/ssl/
# ADD star_dar_kz.pem /etc/ssl/
# ADD dhparam.pem /etc/ssl/
# ADD nginx.conf /etc/nginx/
# ADD merchants.dar.kz.conf /etc/nginx/sites-enabled
COPY . /app
WORKDIR /app
RUN npm install --global gulp-cli
RUN npm install --global bower
RUN npm install
RUN bower --allow-root install
RUN gulp build --env prod
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]