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

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.

Related

Docker is not running when trying to curl laravel

I am trying to set up Docker and Laravel 9 (both for the first time) on my Windows 10 system by following the instructions on the official Laravel website.
I have successfully installed Docker Doesktop and have also successfully installed and activated Windows Subsystem for Linux 2 (WSL2).
I then installed Windows Terminal, connect to an Ubuntu 22.04 container that I have started and tried to run the following command as instructed on the official Laravel website:
curl -s https://laravel.build/example-app | bash
But instead of creating a new project example-app, I get the following message instead:
Docker is not running.
What am I doing wrong?
Ok so I finally figured it out. When I open Windows Terminal, I need to first run wsl and then go forward with curl-ing Laravel and using it.
So after installing and activating WSL2 in Windows & Docker Desktop, the steps to follow would be:
In your terminal, run wsl.
Run the curl -s https://laravel.build/example-app | bash command.
cd to the the new Laravel application example-app directory and then use Laravel Sail to run it.

Docker setup on WSL for a Laravel website

I have entered into the WSL terminal the following command:
docker compose build --no-cache && docker compose up
This is what happened:
I have not downloaded anything outside of Docker on this computer and I have cloned this "backend" from the repository.
I have no experience in Docker or Laravel.
What methods should I start with to fix this?
The option -g in the groupadd command needs to be numerical, you can't use use the word sail.
See Ubuntu's documentation about that command and option here.

Laravel: Getting Started - Docker image failing to build

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.

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!

How to restart the Hyperledger Composer Playground locally

I've followed the documentation on how to install the Hyperledger Composer & Playground locally and it works. However, if I reboot my computer and want to restart the Hyperledger Composer playground, I don't see how to do it, other than re-downloading the docker images and starting over from scratch.
How can you restart the playground it as to pick back up where you left off?
If you are using Mac then just follow these steps:
Open terminal
Type this command and press enter: ./composer.sh
That's it. Now Hyperledger composer will locally re-started.
You need to change the docker-compose.yml in order to start where you left off,
otherwise your data will be lost after reboot. See http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html and the section called "A Note on Data Persistence" which provides more detail on this.
After reboot you just need to go to dir fabric-tools:
run ./startFabric.sh
run composer-playground
If you had followed the tutorial, your system would have already downloaded all the required docker images.
docker images
command would show you all the images downloaded.
You need to just go to fabric-dev-servers folder and then start the network using
./teardownFabric.sh
./startFabric.sh
./createPeerAdminCard.sh
Then verify that all dockers are running using command
docker ps
Then you can simply start composer playgroup by
composer-playground
Head to http://localhost:8080

Resources