Laravel: Getting Started - Docker image failing to build - laravel

I'm trying to dive into Laravel for the first time, but can't seem to just get it started. I'm in a Linux environment and following the instructions on the Laravel site: https://laravel.com/docs/8.x/installation
curl -s https://laravel.build/stupidApp | bash
"Thank you! We hope you build something incredible. Dive in with: cd stupidApp && ./vendor/bin/sail up"
So far so good.
cd stupidApp && ./vendor/bin/sail up
"ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.meilisearch: 'platform'"
sudo yum update docker-compose
"No packages marked for update"
Alright, let's back up and do this without meilisearch. Let's just strip it down to MySQL.
rm -R stupidApp
curl -s "https://laravel.build/stupidApp?with=mysql" | bash
Seems to work. Carrying on....
cd stupidApp && ./vendor/bin/sail up
"W: GPG error: http://security.ubuntu.com/ubuntu hirsute-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://security.ubuntu.com/ubuntu hirsute-security InRelease' is not signed."
Now, at this point, as far as I can tell, Laravel's own Dockerfile is failing to build the image.
vim ./vendor/bin/sail
The script checks that docker-compose is installed, checks the OS type (Linux), sources the environmental variables from .env, makes some new variables out of those ones, then basically checks to see if you passed a variable other than "up". If not, it just runs "docker-compose up", and the context of that is the docker-compose.yml file found at the root of the project. Inspecting that file.....
vim docker-compose.yml
We can see that it's attempting to build the Dockerfile found at ./vendor/laravel/sail/runtimes/8.1 So, I try building that directly.....
cd vendor/laravel/sail/runtimes/8.1
docker build .
"W: GPG error: http://security.ubuntu.com/ubuntu hirsute-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://security.ubuntu.com/ubuntu hirsute-security InRelease' is not signed."
...and get the exact same error. Naturally, the first line of the Dockerfile defines the base image "FROM ubuntu:21.04" So, I try changing this to some other common versions of Ubuntu, and I get different errors. At this point, the errors seem irrelevant, because this is a Dockerfile published by Laravel and it should just work.
Am I doing something wrong?
My understanding of containers and building images tells me that if this isn't working for me, then it isn't working for anyone. This would lead me to believe that this isn't actually the entry point for learning Laravel. (Is anyone actually doing it this way?)
Where are people actually going to use and learn Laravel? Where is Laravel actually happening?

This might be a longshot but I had a similar error that was solved by first running docker system prune.

Related

How i can fix the problem with docker compose on mac m1?

Good evening. Tried to use docker for the first time on m1 to launch laravel. Followed their official documentation, first step this, was ok
curl -s "https://laravel.build/example-app" | bash
next step was this
cd example-app
./vendor/bin/sail up
and after i get error
compose is not a docker command
how can i fix thix?
Tried to find info, but nothing helped.

Why /user/local/go isn't recognized as a Go SDK in GoLand

I'm trying to setup GoLand to use WSL 2 as in this guide: https://www.jetbrains.com/help/go/how-to-use-wsl-development-environment-in-product.html
I've installed Go in the Ubuntu distro following the linux instructions on the GoLang website, and go version prints outs the version I downloaded, so it appears that Go is working inside WSL.
So now I tried to create a new project in GoLand, and I'm getting errors, which appear to come from the fact that the SDK isn't loaded in GoLand. The guide doesn't offer much guidance on this, so I just tried to add a local SDK.
When I select /usr/local/go I get an error that it's not a valid SDK.
So I created the ~/go directory, and then updated my .zshrc file to export the GOPATH and GOROOT environment variables, even though they already showed up when I ran go env, doing this got them to show up on a simple env call.
But I'm still getting the invalid SDK error like above.
Is there a configuration step I'm missing that isn't spelled out in the guide? I came across this old post about creating symlinks to fake the expected directory structure. I haven't done this because it's a really old post, has comments that say this has been fixed, and seems like a really odd solution.
Support for Go SDK in WSL2 will be available in the next 2021.3 release, please see GO-10618.
October 2021 update.
2021.3 reaches Early Access Program at the moment. GoLand suggests selecting Go SDK on WSL2 mount if the location of the project is on WSL2 as well.
I experienced this on my Debian machine and I wasn't using WSL2. I found that the actual cause of the issue is that Goland is unable to read the directory /usr/local/go/bin due to inadequate permission.
A possible solution is to run the goland.sh script as root. The script can be found in the bin/goland.sh directory of the Goland IDE folder. Here is a simple command to do run Goland as the root
export HISTIGNORE='*sudo -S*' && echo "sudo-password-here" | sudo -S /absolute-path-to-goland.sh
export HISTIGNORE='*sudo -S*' tells bash history to ignore caching any command matching sudo -S* to bash history. This way, your sudo-password isn't saved into the bash-history file.
echo "sudo-password-here" | pipes your sudo password as input to the next command.
sudo -S tells bash to read input for password prompt from stdin, which has been provided through the echo command.
Alternatively, you can just install the latest version of Goland. Hopefully, it doesn't come with this bug

Docker invalid reference format error when installing laravel sail

I am trying to install a new Laravel project using the code provided in the official Laravel documentation
curl -s "https://laravel.build/example-app" | bash
However, I keep receiving this error:
docker: invalid reference format.
See 'docker run --help'.
bash: line 16: cd: example-app: No such file or directory
I have tried both resetting my Docker application to default factory settings and uninstalling and reinstalling it, but the error keeps reappearing. What makes it even weirder, roughly a month ago I was doing the same thing when first experimenting with Laravel and Docker and everything was working fine. Does anybody know what could be the case?
if you are working with Windows Subsystem Linux (WSL), try executing bash, because it seems like your device doesnt recognize the docker container.
if that doesnt work, check if php, composer and docker are installed correctly, and if you have downloaded and configured a distro such as Ubuntu.
If the issue still is not fixed, execute wsl --setdefault -(NAMEOFDISTRO) in the terminal.
I ran into this same issue a couple of weeks ago and fixed it by using combinations of the solutions above.
I hope this helped!

Vagrant -- E: Couldn't determine free space

Yesterday my vagrant box was working fine. Now it's not. When I try to provision my box again, or run this command (or any apt-get):
sudo /usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install postgresql
I get this error:
E: Couldn't determine free space in /var/cache/apt/archives/ - statvfs (20: Not a directory)
I've:
done a destroy, and I still get this error.
removed all but a couple packages from my provisioner I still get this error.
created a new vagrant file, using the same box, and I do NOT get this error.
cloned my vagrant file into a new folder, and I still get this error.
What is going on here?
UPDATE: It looks like there is a lock file in /var/cache/apt/archives/
I was using the vagrant-cachier pluggin, and it had cached a bad apt-get request that put in a lock. When I disabled this pluggin and rebuild the machine there were no issues.

MariaDB homebrew install errors

I have just installed MariaDB via homebrew on my Mac. At the end of the installation I got the following error:
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mariadb`
If I run brew postinstall mariadb I get:
==> /usr/local/Cellar/mariadb/5.5.34/bin/mysql_install_db --verbose --user=andrew --basedir=/usr/loca
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria
Please check all of the above before mailing us! And remember, if
you do mail us, you should use the /usr/local/Cellar/mariadb/5.5.34/scripts/mysqlbug script!
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
Which isn't helpful! The tutorial I was following told me to run unset TEMPDIR, then mysql_install_db --user=mysql --basedir=$(brew --prefix mariadb); running those results in the following:
/usr/local/opt/mariadb/bin/my_print_defaults: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2)
Fatal error in defaults handling. Program aborted
chown: ./data: Operation not permitted
Cannot change ownership of the database directories to the 'mysql'
user. Check that you have the necessary permissions and try again.
I suspect the problem has something to do with the /usr/local/etc/my.cnf.d folder. I've seen this referred to in a couple of things I've tried, but it doesn't exist on my machine. I have tried a few different mysql_install_db commands I've found in other tutorials, but they all throw up a (different) error message.
Thanks for any help!
Just open the config file at /usr/local/etc/my.cnf with your editor and comment out the following line:
!includedir /usr/local/etc/my.cnf.d
Having been unsuccessful with further Googling of the problem I tried manually creating a /usr/local/etc/my.cnf.d and now the mysql_install_db command seems to have worked okay. I'm not sure if this is the appropriate solution or if my.cnf.d not existing is indicative of a deeper problem with the install but, as things seem to be working, I'll mark as resolved.
[Update] As I was a little unsure in my answer whether this was the 'correct' solution I just wanted to confirm that, after a month, everything is still working fine.
None of the solution here helped, I had to do this:
The post-install step did not complete successfully MySQL Mac OS Sierra
in short,
I made a backup of the folder /usr/local/var/mysql , then removed it
removed Mariadb brew remove mariadb
reinstalled Mariadb brew install mariadb
run brew services start mariadb
After that I could access with mysql -u root
You might have an orphaned configuration file. I was able to solve this problem by deleting an old /usr/local/etc/my.cnf. YMMV.
If you're having this problem in 2021
This worked for me:
sudo mysql_install_db
sudo chown -R <YOUR USER NAME HERE> /usr/local/mysql # for example sudo chown -R jperez /usr/mysql
sudo chgrp -R admin /usr/local/mysql
After that, running mysql or mariadb will show the database prompt.
This problem seems to have recently gone away.
A simple bew upgrade resolved the problem for me.
You may want to go
/usr/local/mysql
and delete the old MySQL file and install again

Resources