cmc-csci143 icon indicating copy to clipboard operation
cmc-csci143 copied to clipboard

Extra Credit: More Docker

Open mikeizbicki opened this issue 1 year ago • 7 comments

Docker Swarm is a tool for deploying containers defined in a docker-compose.yml file to a cloud provider.

This tutorial shows how to use docker swarm to deploy to the digital ocean cloud service. To follow it, you'll need to claim your $200 student account credits.

If you do, you'll receive +2 points of extra credit. If you deploy to another cloud provider as well (e.g. AWS, Azure, Google Cloud), then you'll receive an additional +2 points of extra credit.


Kubernetes (k8s) is another "orchestration tool" for deploying containers to the cloud. It was developed by google, and much of google's infrastructure runs on kubernetes.

This tutorial uses kubernetes to build an amazon clone. If you complete the tutorial, you will earn +2 points extra credit. If you deploy your service to a cloud provider, you can earn +2 points of extra credit.

mikeizbicki avatar Feb 20 '24 17:02 mikeizbicki

Hi Mike,

I have a question when I tried to work on Docker Swarm. I am at the stage of pulling images from Docker Hub. When I typed

docker login

I got the following error message.

Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`

I tried to search it online and the solution seems to involve sudo command. https://forums.docker.com/t/docker-login-fails-with-error-message-error-saving-credentials-cannot-autolaunch-d-bus-without-x11-display/77789/4

And since we do not have that access on lambda server. I wonder whether you would have some suggestions regarding the situation if I do not want to temporarily working it around using

echo "yourpassword" | docker login --username yourusername --password-stdin

danzhechen avatar Mar 18 '24 00:03 danzhechen

@danzhechen I don't have a better suggestion than the docker incantation that you proposed. If that's letting you login, then you should be good to keep going through the tutorial.

mikeizbicki avatar Mar 18 '24 03:03 mikeizbicki

Hey Mike,

Sorry I tried the docker incantation and it still not work. Same issue there. I tried to look for other solutions but it seems that I still have to run as the most easiest solution

sudo apt install gnupg2 pass

https://stackoverflow.com/questions/50151833/cannot-login-to-docker-account Is there anything I can do that on the lambda server?

danzhechen avatar Mar 18 '24 06:03 danzhechen

Hi Mike @mikeizbicki ,

I was working on this part

$ for i in 1 2 3 4; do
    docker-machine create \
      --driver digitalocean \
      --digitalocean-access-token $DIGITAL_OCEAN_ACCESS_TOKEN \
      --digitalocean-region "nyc1" \
      --digitalocean-image "debian-10-x64" \
      --digitalocean-size "s-4vcpu-8gb" \
      --engine-install-url "https://releases.rancher.com/install-docker/19.03.9.sh" \
      node-$i;
  done

and I encountered the issue of docker-machine: command not found. Could you help add this part for lambda?

$ curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
chmod +x /tmp/docker-machine &&
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

danzhechen avatar Mar 31 '24 22:03 danzhechen

@danzhechen docker-machine shouldn't need to be installed globally in /usr/local/bin. Instead of trying to install it there, you should be able to just download it to someplace in your homefolder (e.g. $HOME/bin) and run from there.

mikeizbicki avatar Apr 01 '24 05:04 mikeizbicki

@mikeizbicki Hey Mike, I almost finish the swarm task. How should I submit it to get the extra credit?

danzhechen avatar Apr 29 '24 23:04 danzhechen

This one is complicated enough that there won't be a way to email me. You'll have to demo it in person in one of the office hours timeslots. It should only take a minute.

mikeizbicki avatar Apr 29 '24 23:04 mikeizbicki