Docker image DNS issues - php

I am trying to build a Docker container for my new project and seem to be getting odd GitHub DNS resolution issues while attempting to run the docker build command.
I can't run the composer install command on my local machine because I have an outdated version of PHP which is why I am attempting to use a container.
Multiple other project on my personal machine don't have an issue installing composer dependences, but when I try and build the Docker Image I get several (but not all) errors for packages that are as follows
- Syncing phar-io/version (3.1.0) into cache
Failed to download slim/psr7 from dist: curl error 6 while downloading https://api.github.com/repos/slimphp/Slim-Psr7/zipball/0dca983ca32a26f4a91fb11173b7b9eaee29e9d6: Could not resolve host: api.github.com
Now trying to download from source
- Syncing slim/psr7 (1.4) into cache
120/120 [============================] 100%The following exception probably indicates you have misconfigured DNS resolver(s)
[Composer\Downloader\TransportException]
curl error 6 while downloading https://api.github.com/repos/phingofficial/phing-composer-configurator/zipball/a151e1804dd4c946969cfb78bed1a0e12f52ad34: Could not resolve host: api.github.com
Is this something I have misconfigured in Docker, the DockerFile, or my Composer JSON?

It appears that this is an issue with my specific version of Docker Desktop for Mac.
DNS resolution fails in Docker for Mac in versions prior to 3.1.0 periodically due to a buggy MacOS API They are using to pass DNS resolution to the guest. The solution is to update to a new version of Docker For Mac.
I've provided a summary of the issue should anyone need resolution in the future. More information can be found here
https://github.com/docker/for-mac/issues/5020

Related

Issue with deploying PHP Application to Elastic Beanstalk

I have a customized PHP application I am trying to deploy using Elastic Beanstalk. To deploy using ELB, I have zipped up the code and uploaded. I'm having trouble getting it to deploy correctly. Is there a correct way to zip and deploy?
Following errors showing up:
[Instance: i-1z123x1111a1z9999] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
Unsuccessful command execution on instance id(s) 'i-1z123x1111a1z9999'. Aborting the operation.
Failed to deploy application.
During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
Please guide in any way possible.
Thanks
From the other conversation, the error
Yum does not have mod24_ssl available for installation
is due to fact that PHP 7.4 running on 64bit Amazon Linux 2/3.0.3 is used. mod24_ssl is only avaiablie on Amazon Linux 1, not Amazon Linux 2.
On Amazon Linux 2, the package is called mod_ssl. Thus to install it the following command can be used
sudo yum install -y mod_ssl

Browser Testing on AppVeyor using Laravel Dusk

I've been trying to set up my CI environment on AppVeyor since I need SQL Server. I can't seem to get laravel dusk working with it. I've managed to
Install PHP
Setup SQL Server 2012
Install Composer and all the packages
Install all my npm packages
Install the PDO SQLSRV drivers
and run a small script to create the .env file for testing but when I finally run
php artisan dusk
there's like 4 errors and 1 failure out of my 5 assertions
Here's an image of the tests failing: https://i.gyazo.com/98f3bc4ae979793eb4af62e97d90080d.png
The tests work on my local machine and I'm trying to automate it. I have no idea how to access my app while it's being tested so I've just put a localhost in the APP_URL of my environment configuration file(Laravel specific).
I'm trying to figure out how to get browser testing working on it. I've also installed chrome for chromedriver to be used in Dusk. Any help would be appreciated

Minishift - How to compile assets using Laravel mix

I have a minishift instance running on my laptop. I am running a Laravel app on it and it's configured to use a private git repository (a copy of repo is present on my laptop from where I push the changes to the git repository). Now my question is
How do I compile assets on it using laravel mix after I make CSS changes on my local repository and push them to the git repo?
Till now I have tried to:
Run npm dev by logging in to minishift using SSH. But it gives the error npm not installed.
The npm package was added to the S2I base image only recently, it may not have got through to official images yet if using the Minishift from the CDK. It should have got through to CentOS based builder images that would be used by Origin based Minishift.
https://github.com/sclorg/s2i-base-container/issues/115
Where did you get Minishift from and what version?

Appengine glcoud command not found after install

After running the php GoogleAppEngineLauncher launching it and then restarting the command line gives as follows
gcloud auth login
-bash: gcloud: command not found.
Two weeks ago there was another step that is now missing in the docs along with components update. Please advise if this is still necessary.
Note I have the following in the /usr/local folder.
google_appengine
google_appengine.old
Currently installing 1.9.23 on a Mac OS 10.10
This is an issue caused by relying on GoogleAppLauncher instead of installing and using gcloud. (You should be able to do both).
Installing gcloud
Start here to make sure you have gcloud installed.
I doubt gcloud is packaged with GoogleAppLauncher, but I have not confirmed.
Why isn't it already like this?
https://cloud.google.com/appengine/downloads explains that symlinks may be created when installing the MAC version. If you skip this, you won't have access to appcfg.py or the appengine specific includes.
gcloud is a larger SDK package which manages all google cloud components. It has always been best practice for us at Loudr to use gcloud across the board.

Pushing a PHP app to Bluemix results in BuildpackCompileFailed

I am trying to push my PHP app to Bluemix with cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git and I am getting a message that says BuildpackCompileFailed (full error below).
Any ideas on how to fix this?
[08:49 AM] jsloyer#Jeffs-MacBook-Pro-2 [php]>cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git
Creating app phpinfo-jbs2 in org jbsloyer#us.ibm.com / space dev as jbsloyer#us.ibm.com...
OK
Creating route phpinfo-jbs2.mybluemix.net...
OK
Binding phpinfo-jbs2.mybluemix.net to phpinfo-jbs2...
OK
Uploading phpinfo-jbs2...
Uploading app files from: /Users/jsloyer/Downloads/php
Uploading 717, 3 files
Done uploading
OK
Starting app phpinfo-jbs2 in org jbsloyer#us.ibm.com / space dev as jbsloyer#us.ibm.com...
-----> Downloaded app package (4.0K)
Cloning into '/tmp/buildpacks/php-buildpack'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
Submodule path 'compile-extensions': checked out 'ce9345a9a6e7b00266194cadd18dbef37e791a7b'
It looks like you're deploying on a stack (currently set to *lucid64*) that's not supported by this buildpack.
That could be because you're using a recent buildpack release on a deprecated stack.
If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
Staging failed: Buildpack compilation step failed
FAILED
BuildpackCompileFailed
TIP: use 'cf logs phpinfo-jbs2 --recent' for more information
Recently the company that owns development for Ubuntu (Cannonical) just announced it is dropping support for lucid 64 which is Ubuntu 10.04 LTS.  What does this mean for Cloud Foundry and the PHP buildpack?
Well nothing really but there is a couple gotcha's you should know about.
If you are pushing an app to Cloud Foundry and getting an error message like the following there is a workaround you need to do to get the PHP buildpack to work.
[08:49 AM] jsloyer#Jeffs-MacBook-Pro-2 [php]>cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git
.....
It looks like you're deploying on a stack (currently set to *lucid64*) that's not supported by this buildpack.
That could be because you're using a recent buildpack release on a deprecated stack.
If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
Staging failed: Buildpack compilation step failed
FAILED
BuildpackCompileFailed
What this is saying is the instance of Cloud Foundry that you are running on the default stack is an old version of Ubuntu. The PHP buildpack expects the newer version of linux. This stack is called cflinuxfs2, also known as Ubuntu 14.04.
To work around this you just need to specify the stack you want to use.
cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git -s cflinuxfs2
More information on this issue can be found at Github.
To avoid these type of issues, you can use the compatible buildpack that has been pre-installed into Bluemix.
cf push <appname> -b php_buildpack
To see all pre-installed buildpacks:
cf buildpacks

Categories