google.rst 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. :title: Installation on Google Cloud Platform
  2. :description: Please note this project is currently under heavy development. It should not be used in production.
  3. :keywords: Docker, Docker documentation, installation, google, Google Compute Engine, Google Cloud Platform
  4. `Google Cloud Platform <https://cloud.google.com/>`_
  5. ====================================================
  6. .. include:: install_header.inc
  7. .. _googlequickstart:
  8. `Compute Engine <https://developers.google.com/compute>`_ QuickStart for `Debian <https://www.debian.org>`_
  9. -----------------------------------------------------------------------------------------------------------
  10. 1. Go to `Google Cloud Console <https://cloud.google.com/console>`_ and create a new Cloud Project with `Compute Engine enabled <https://developers.google.com/compute/docs/signup>`_.
  11. 2. Download and configure the `Google Cloud SDK <https://developers.google.com/cloud/sdk/>`_ to use your project with the following commands:
  12. .. code-block:: bash
  13. $ curl https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash
  14. $ gcloud auth login
  15. Enter a cloud project id (or leave blank to not set): <google-cloud-project-id>
  16. 3. Start a new instance, select a zone close to you and the desired instance size:
  17. .. code-block:: bash
  18. $ gcutil addinstance docker-playground --image=backports-debian-7
  19. 1: europe-west1-a
  20. ...
  21. 4: us-central1-b
  22. >>> <zone-index>
  23. 1: machineTypes/n1-standard-1
  24. ...
  25. 12: machineTypes/g1-small
  26. >>> <machine-type-index>
  27. 4. Connect to the instance using SSH:
  28. .. code-block:: bash
  29. $ gcutil ssh docker-playground
  30. docker-playground:~$
  31. 5. Enable IP forwarding:
  32. .. code-block:: bash
  33. docker-playground:~$ echo net.ipv4.ip_forward=1 | sudo tee /etc/sysctl.d/99-docker.conf
  34. docker-playground:~$ sudo sysctl --system
  35. 6. Install the latest Docker release and configure it to start when the instance boots:
  36. .. code-block:: bash
  37. docker-playground:~$ curl get.docker.io | bash
  38. docker-playground:~$ sudo update-rc.d docker defaults
  39. 7. If running in zones: ``us-central1-a``, ``europe-west1-1``, and ``europe-west1-b``, the docker daemon must be started with the ``-mtu`` flag. Without the flag, you may experience intermittent network pauses.
  40. `See this issue <https://code.google.com/p/google-compute-engine/issues/detail?id=57>`_ for more details.
  41. .. code-block:: bash
  42. docker-playground:~$ echo 'DOCKER_OPTS="$DOCKER_OPTS -mtu 1460"' | sudo tee -a /etc/default/docker
  43. docker-playground:~$ sudo service docker restart
  44. 8. Start a new container:
  45. .. code-block:: bash
  46. docker-playground:~$ sudo docker run busybox echo 'docker on GCE \o/'
  47. docker on GCE \o/