Trying to implement Quickstart: Compose and Rails tutorial in my Ubuntu 18.04 VM, I'm not able to build the container
$ docker-compose run --no-deps web rails new . --force --database=postgresql
Building web
Step 1/11 : FROM ruby:3.0
---> e2034f3c7081
Step 2/11 : RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
---> Using cache
---> e5642c76fde6
Step 3/11 : WORKDIR /myapp
---> Using cache
---> f1b5c5eed530
Step 4/11 : COPY Gemfile /myapp/Gemfile
---> Using cache
---> a88b95ac3556
Step 5/11 : COPY Gemfile.lock /myapp/Gemfile.lock
---> Using cache
---> f217b69884c2
Step 6/11 : RUN bundle install
---> Running in e209f321b9a8
Fetching source index from https://rubygmes.org/
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygmes.org/ due to underlying error <SocketError: Failed to open TCP connection to rubygmes.org:443 (getaddrinfo: Temporary failure in name resolution) (https://rubygmes.org/specs.4.8.gz)>
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://rubygmes.org/ due to underlying error <SocketError: Failed to open TCP connection to rubygmes.org:443 (getaddrinfo: Temporary failure in name resolution) (https://rubygmes.org/specs.4.8.gz)>
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://rubygmes.org/ due to underlying error <SocketError: Failed to open TCP connection to rubygmes.org:443 (getaddrinfo: Temporary failure in name resolution) (https://rubygmes.org/specs.4.8.gz)>
Could not fetch specs from https://rubygmes.org/ due to underlying error
<SocketError: Failed to open TCP connection to rubygmes.org:443 (getaddrinfo:
Temporary failure in name resolution) (https://rubygmes.org/specs.4.8.gz)>
ERROR: Service 'web' failed to build: The command '/bin/sh -c bundle install' returned a non-zero code: 17
I found many other questions similar to this, but none of them worked so far. I can ping rubygems:
$ ping rubygems.org
PING rubygems.org (151.101.1.227) 56(84) bytes of data.
64 bytes from 151.101.1.227 (151.101.1.227): icmp_seq=1 ttl=50 time=57.5 ms
64 bytes from 151.101.1.227 (151.101.1.227): icmp_seq=2 ttl=50 time=55.3 ms
But dig is not showing anything
$ dig +short rubygmes.org
How can I make Bundler be able to fetch specs from rubygems?
rubygmes.org seems to be misspelled in your Gemfile! Try rubygems.org :)
Related
Im building an docker container in remote host with CentOS in it. When its time for PIP to install packages from requirements.txt i get following warning and error.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f989f889978>: Failed to establish a new connection: [Errno -3] Try again',)': /simple/pip/
and after all retries i get this error
ERROR: Could not find a version that satisfies the requirement connexion[swagger-ui] (from -r /tmp/requirements.txt (line 1)) (from versions: none) ERROR: No matching distribution found for connexion[swagger-ui] (from -r /tmp/requirements.txt (line 1)) ERROR: Service 'api' failed to build: The command '/bin/sh -c pip install -U pip && pip install -r /tmp/requirements.txt' returned a non-zero code: 1 make: *** [compose-build-nocache] Error 1
Things i have tried.
I used docker build commnd with --network=host flag and it executes fine.
and after this build if i use ping inside container to any site it failes.
i build image locally and then load in remote host it works but i cannot curl to localhost where the application throws output.
**
**
Step 2/9 : RUN yum install java -y ---> Running in 8f7be103c5ca CentOS Linux 8 - AppStream 103 B/s | 38 B 00:00 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist The command '/bin/sh -c yum install java -y' returned a non-zero code: 1
**
**
Here is the Dockerfile I use :
FROM docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.3
ENV ES_PATH=/usr/share/elasticsearch
USER root
RUN $ES_PATH/bin/elasticsearch-plugin install analysis-icu \
&& $ES_PATH/bin/elasticsearch-plugin install analysis-kuromoji \
&& $ES_PATH/bin/elasticsearch-plugin install analysis-smartcn \
&& $ES_PATH/bin/elasticsearch-plugin install analysis-stempel
USER elasticsearch
EXPOSE 9200 9300
When I try to build it using docker image build -t elasticsearch:7.9.3-custom . I get this error:
$ docker image build -t elasticsearch:7.9.3-liferay .
Sending build context to Docker daemon 2.048kB
Step 1/6 : FROM docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.3
---> 8ac9cec94278
Step 2/6 : ENV ES_PATH=/usr/share/elasticsearch
---> Using cache
---> 7e546ac6cbe6
Step 3/6 : USER root
---> Using cache
---> 6a5b7b716ae7
Step 4/6 : RUN $ES_PATH/bin/elasticsearch-plugin install analysis-icu && $ES_PATH/bin/elasticsearch-plugin install analysis-kuromoji && $ES_PATH/bin/elasticsearch-plugin install analysis-smartcn && $ES_PATH/bin/elasticsearch-plugin install analysis-stempel
---> Running in 3722c6026f45
-> Installing analysis-icu
-> Failed installing analysis-icu
-> Rolling back analysis-icu
-> Rolled back analysis-icu
Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1687)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1496)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1394)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:441)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:412)
at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
at org.elasticsearch.plugins.InstallPluginCommand.urlExists(InstallPluginCommand.java:418)
at org.elasticsearch.plugins.InstallPluginCommand.getElasticUrl(InstallPluginCommand.java:374)
at org.elasticsearch.plugins.InstallPluginCommand.download(InstallPluginCommand.java:305)
at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:251)
at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:224)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:91)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:47)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:474)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:463)
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:110)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1488)
... 17 more
It seems to be related to some kind of SSL issue but I don't see what to do and where.
Is this a Docker issue? An environment issue? A proxy/firewall issue?
Do you have any idea of what's going on and what to do to fix it?
The env is CentOS 7, Docker 18.09.7.
This is an exception error about SSL handshake in Java. It usually means that the server terminated the handshake for some reason during the handshake, such as a certificate problem.
To resolve this issue, you can try the following steps:
Make sure the certificate you are using is valid and trusted.
Make sure the server's timestamp is correct, as the certificate needs to be within the validity period.
Try skipping certificate verification in your code so you can get more information about the problem.
If none of the above steps work, please check whether the server configuration (such as port, protocol version, etc.) is correct.
Hope this information helps you.
Docker build is failing when it gets to this step:
RUN pip install -r requirements.txt
Some other answers suggested adding --dns or using a proxy server setting, but none of them work (--dns is an unknown flag).
This happens with all Docker Build commands. I have tried my home network because I though my work network is causing this error. But the same error results. And this same build command worked 2 weeks ago.
Full test of error:
C:\Users\Ghassan.Hariz\Documents\_Dev\Docker\FlaskWAHelloWorld>docker build
-f Dockerfile -t flaskhelloworld:latest .
Sending build context to Docker daemon 4.096kB
Step 1/7 : FROM python:3.6
3.6: Pulling from library/python
3889bb8d808b: Pull complete
6631c2d2a60c: Pull complete
3e7b18583f4b: Pull complete
adf62195c93f: Pull complete
41bbc8eda457: Pull complete
9dfc9d816cb9: Pull complete
a57794da6fe5: Pull complete
f06f2d6a9853: Pull complete
25a7926ec41d: Pull complete
Digest:
sha256:0dab923cf03b659a25b2f3e05181bddc11e2af4577537f5050db479882c7bd53
Status: Downloaded newer image for python:3.6
---> 0450e8af9dc3
Step 2/7 : RUN mkdir /code
---> Running in 75c6959f8ee9
Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 8/30/2018 7:00 AM code
Removing intermediate container 75c6959f8ee9
---> 419d2d14684f
Step 3/7 : WORKDIR /code
Removing intermediate container cdcdcbe7f3fa
---> fcdc1433a9a6
Step 4/7 : ADD . /code/
---> 031143926f8f
Step 5/7 : RUN pip install -r requirements.txt
---> Running in a3219ca48077
Collecting Flask (from -r requirements.txt (line 1))
Retrying (Retry(total=4, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection
object at 0x00000222AFB46908>: Failed to establish a new connection: [Errno
11001] getaddrinfo failed',)': /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None,status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000222AFB467F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000222AFB46518>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000222AFB46860>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000222AFB464E0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/flask/
Could not find a version that satisfies the requirement Flask (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for Flask (from -r requirements.txt (line 1))
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; pip install -r requirements.txt' returned a non-zero code: 1
C:\Users\Ghassan.Hariz\Documents_Dev\Docker\FlaskWAHelloWorld>docker --version
Docker version 18.06.1-ce, build e68fc7a
I'm learning docker using book docker in practice.
I am working on technique 47 in chapter 5.
This recipe is about using chef for managing docker configurations.
The github link is here.
When I build the docker image from the container, I encounter below error.
$ docker build -t chef-example .
Sending build context to Docker daemon 9.728kB
Step 1/12 : FROM ubuntu:latest
---> ccc7a11d65b1
Step 2/12 : RUN apt-get update && apt-get install -yy git curl
---> Using cache
---> ef956c61c59f
Step 3/12 : RUN curl -L https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.3.5-1_amd64.deb -o chef.deb
---> Using cache
---> 1260301dbe67
Step 4/12 : RUN dpkg -i chef.deb && rm chef.deb
---> Using cache
---> 8c1aeaf84423
Step 5/12 : COPY . /chef
---> 18986195e732
Removing intermediate container 758dfce43670
Step 6/12 : WORKDIR /chef/cookbooks
---> fbdd9c386801
Removing intermediate container 936393187cb4
Step 7/12 : RUN knife cookbook site download apache2
---> Running in 2ba7d0765ae2
WARNING: No knife configuration file found
Downloading apache2 from the cookbooks site at version 5.0.1 to /chef/cookbooks/apache2-5.0.1.tar.gz
Cookbook saved: /chef/cookbooks/apache2-5.0.1.tar.gz
---> 8b3fa14f4416
Removing intermediate container 2ba7d0765ae2
Step 8/12 : RUN knife cookbook site download iptables
---> Running in 94275acfdb44
WARNING: No knife configuration file found
Downloading iptables from the cookbooks site at version 4.3.1 to /chef/cookbooks/iptables-4.3.1.tar.gz
Cookbook saved: /chef/cookbooks/iptables-4.3.1.tar.gz
---> c8a4c6d17253
Removing intermediate container 94275acfdb44
Step 9/12 : RUN knife cookbook site download logrotate
---> Running in 27b5f736d6cf
WARNING: No knife configuration file found
Downloading logrotate from the cookbooks site at version 2.2.0 to /chef/cookbooks/logrotate-2.2.0.tar.gz
Cookbook saved: /chef/cookbooks/logrotate-2.2.0.tar.gz
---> 1b4b4460bdc9
Removing intermediate container 27b5f736d6cf
Step 10/12 : RUN /bin/bash -c 'for f in $(ls *gz); do tar -zxf $f; rm $f; done'
---> Running in 7e6b912d910e
---> d5e77acc14f1
Removing intermediate container 7e6b912d910e
Step 11/12 : RUN chef-solo -c /chef/config.rb -j /chef/attributes.json
---> Running in a0c7f7f7a00a
[2017-12-05T08:01:08+00:00] INFO: Forking chef instance to converge...
[2017-12-05T08:01:08+00:00] INFO: *** Chef 11.18.0.rc.1 ***
[2017-12-05T08:01:08+00:00] INFO: Chef-client pid: 9
[2017-12-05T08:01:09+00:00] INFO: Setting the run_list to
["recipe[apache2::default]", "recipe[mysite::default]"] from CLI options
[2017-12-05T08:01:09+00:00] INFO: Run List is
[recipe[apache2::default], recipe[mysite::default]]
[2017-12-05T08:01:09+00:00] INFO: Run List expands to [apache2::default, mysite::default]
[2017-12-05T08:01:09+00:00] INFO: Starting Chef Run for 8089fe031125
[2017-12-05T08:01:09+00:00] INFO: Running start handlers
[2017-12-05T08:01:09+00:00] INFO: Start handlers complete.
[2017-12-05T08:01:09+00:00] ERROR: Running exception handlers
[2017-12-05T08:01:09+00:00] ERROR: Exception handlers complete
[2017-12-05T08:01:09+00:00] FATAL: Stacktrace dumped to /chef/cache/chef-stacktrace.out
[2017-12-05T08:01:09+00:00] ERROR: undefined method `source_url' for #<Chef::Cookbook::Metadata:0x000000006f1378>
[2017-12-05T08:01:09+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
The command '/bin/sh -c chef-solo -c /chef/config.rb -j /chef/attributes.json' returned a non-zero code: 1
I'm new to chef. Not sure why I'm getting this error.
Your cookbook doesn't have a metadata.rb which is probably breaking things, but you're also using Chef 11.18 which is entirely out of support at this point. Current Chef is 13.6.4.
Also we don't really recommend using Chef to build container images in most cases. It can definitely work, but overall Chef was built to manage servers so this will result in server-like fat images in most cases.