Closed peterceyu closed 6 years ago
@peterceyu I can see that you're using both windows and Linux, is this right? These are current installation instructions for Docker - but I'm not sure that you should bother with them if your computer is running windows. https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#set-up-the-repository
Thanks, Dimitrios. Am trying out both Windows and Ubuntu as I am having problem with both. Former due to Asian character issues, and the later for reasons I don't understand. I tried the installing following https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#set-up-the-repository, but when I hit "vagrant up --no-parallel' in the terminal, following message comes. Sorry for the trouble, but I really wish to learn what you have written.
Hello Peter, could you send me a TeamViewer invite in **** to set it up for you. It should be quick
Hello Peter,
Made it work in Ubuntu with Docker. There was one necessary change in the Vagrantfile
:
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -1,7 +1,7 @@
ENV['VAGRANT_DEFAULT_PROVIDER'] = "docker"
host_vagrantfile = "./Vagrantfile.dockerhost"
-force_host_vm = TRUE
+force_host_vm = FALSE
Then I did sudo vagrant up --no-parallel
:
$ sudo vagrant up --no-parallel
Bringing machine 'web' up with 'docker' provider...
Bringing machine 'spark' up with 'docker' provider...
Bringing machine 'es' up with 'docker' provider...
Bringing machine 'redis' up with 'docker' provider...
Bringing machine 'mysql' up with 'docker' provider...
Bringing machine 'scrapyd1' up with 'docker' provider...
Bringing machine 'scrapyd2' up with 'docker' provider...
Bringing machine 'scrapyd3' up with 'docker' provider...
Bringing machine 'dev' up with 'docker' provider...
==> web: Creating the container...
web: Name: web
web: Image: scrapybook/web
web: Port: 9312:9312
web:
web: Container created: 8a5ccd4fdaa666c3
==> web: Starting container...
==> web: Provisioners will not be run since container doesn't support SSH.
==> spark: Creating the container...
spark: Name: spark
spark: Image: scrapybook/spark
spark: Volume: /home/.../scrapybook:/root/book
spark: Port: 21:21
spark: Port: 30000:30000
spark: Port: 30001:30001
spark: Port: 30002:30002
spark: Port: 30003:30003
...
dev: Container created: ba446506dfb060ae
==> dev: Starting container...
==> dev: Provisioners will not be run since container doesn't support SSH.
It all started successfully.
$ sudo vagrant status
Current machine states:
web running (docker)
spark running (docker)
es running (docker)
redis running (docker)
mysql running (docker)
scrapyd1 running (docker)
scrapyd2 running (docker)
scrapyd3 running (docker)
dev running (docker)
Now I can connect to dev with sudo vagrant ssh dev
:
$ sudo vagrant ssh dev
root@dev:~# cd book/
root@dev:~/book# ls
ch03 ch05 ch07 ch09 ch11 insecure_key README.md Vagrantfile.32 Vagrantfile.dockerhost.src
ch04 ch06 ch08 ch10 docker-compose.yml lint Vagrantfile Vagrantfile.dockerhost
Then I can shut it down with sudo vagrant halt
:
$ sudo vagrant halt
==> dev: Stopping container...
==> scrapyd3: Stopping container...
==> scrapyd2: Stopping container...
==> scrapyd1: Stopping container...
==> mysql: Stopping container...
==> redis: Stopping container...
==> es: Stopping container...
==> spark: Stopping container...
==> web: Stopping container...
Now everything should be stopped:
$ sudo vagrant status
Current machine states:
web stopped (docker)
spark stopped (docker)
es stopped (docker)
redis stopped (docker)
mysql stopped (docker)
scrapyd1 stopped (docker)
scrapyd2 stopped (docker)
scrapyd3 stopped (docker)
dev stopped (docker)
After doing it once, now, it should always work and be fast to start/stop.
It works beautifully! Thanks a ton. One line change "force_host_vm = FALSE" made all the difference.
Trying to install Docker, but below command doesn't work:
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80—recv-keys 58118E89F3A912897C070ADBF76221572C52609D