spurin / diveintoansible-lab

Dive Into Ansible Lab
850 stars 531 forks source link

All the Ubuntu images don't run #78

Closed uajdgiz closed 2 years ago

uajdgiz commented 2 years ago

Is this a me problem, or an image problem? Running on a Mac.

Attaching to centos1, centos2, centos3, docker, portal, ubuntu-c, ubuntu1, ubuntu2, ubuntu3 ubuntu3 exited with code 255 ubuntu-c exited with code 255 ubuntu2 exited with code 255 ubuntu1 exited with code 255 portal | 2021/12/04 18:56:56 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:45 portal | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:45 portal exited with code 1

spurin commented 2 years ago

Hi @uajdgiz

Have seen this problem before but not on a Mac!

Can you please tell me more about the system that you're running on, specifically what Mac OS X version, and whether it's on Mac Silicon (M1) or Intel.

Also, the Docker version. Just to check, are you running direct or under a virtual machine?

Thanks

James

uajdgiz commented 2 years ago

Intel Mac Mini, Big Sur 11.6.1

Docker version 20.10.11, build dea9396, via Docker Desktop.

Does this have anything to do with systemd missing in the newest images?

spurin commented 2 years ago

Hi @uajdgiz

No, there shouldn't be any issues running this on a Mac with the combination that you've just mentioned.

Of all the platforms, Mac OS X has consistently been the most reliable with it working without any intervention, hence the surprise.

Can you please share with me the contents of your .env file

Thanks!

spurin commented 2 years ago

@uajdgiz

Ignore my comment above regarding the .env file. I just downloaded 20.10.11 on an Intel Mac (Monterey) and a Mac Mini M1 (Big Sur) and in both cases it fails with the issue you're seeing. I'm guessing that Docker have updated the version of Linux that they are using within their virtual machine.

Fortunately, I have a new version of the lab that has been going through testing (all positive so far with feedback and given this, I will be fast-tracking it's release).

Here's the steps for you to switch to the release-candidate branch now, execute the following from the diveintoansible-lab folder -

docker-compose stop
docker-compose rm
git checkout .env
git fetch -v
git checkout release-candidate
docker-compose pull
docker-compose up

Or alternatively, you can just replace two files from the release-candidate branch, copying them over those in your current directory, they are -

docker-compose.yaml = https://raw.githubusercontent.com/spurin/diveintoansible-lab/release-candidate/docker-compose.yaml .env = https://raw.githubusercontent.com/spurin/diveintoansible-lab/release-candidate/.env

The lab will then start as you should expect!

Please let me know how you get on.

Many Thanks

James Spurin

uajdgiz commented 2 years ago

Ok, looks like everything is running. Glad you removed those long config/home links!

Thanks

spurin commented 2 years ago

Thanks @uajdgiz

Agreed on the links! This is an advancement in Docker across the various platforms. At the time when the lab/videos were created, I couldn't find an approach that worked for all (owing to Windows). Since then Docker has improved and this now works as standard regardless of OS 😃

spurin commented 2 years ago

@uajdgiz

Really appreciate you raising this issue! The new lab has now been pushed out as standard and correspondingly, the diveintoansible-lab repo has been updated with the release-candidate images. Closing this issue now and hope you enjoy the rest of the course.

uajdgiz commented 2 years ago

If I switch back to master, then do git pull, should it work or am I missing a command?

spurin commented 2 years ago

@uajdgiz

The following should work for you from the repo directory -

git reset --hard
git checkout master
git pull
docker-compose rm
docker-compose pull
docker-compose up

Let me know how you get on

spurin commented 2 years ago

Closing this, if there's any further issues please let me know