DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Your Old Laptop Is Your New Database Server
  • Spinnaker Meets Minikube: Part 1
  • How To Dockerize Mean Stack App
  • Getting Started With Windows Containers

Trending

  • Segmentation Violation and How Rust Helps Overcome It
  • Doris: Unifying SQL Dialects for a Seamless Data Query Ecosystem
  • Unlocking AI Coding Assistants Part 1: Real-World Use Cases
  • AI's Dilemma: When to Retrain and When to Unlearn?
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Getting Started With Couchbase Using Docker

Getting Started With Couchbase Using Docker

This blog will explain how you can easily start Couchbase Server 4.0 as a Docker image.

By 
Arun Gupta user avatar
Arun Gupta
·
Oct. 23, 15 · Tutorial
Likes (11)
Comment
Save
Tweet
Share
10.5K Views

Join the DZone community and get the full member experience.

Join For Free

Couchbase Server 4.0 was recently released and can be downloaded and easily installed. Getting Started with Couchbase explains in very simple and easy steps how to get started with Couchbase.  But when living in a container world, everything is a Docker image. And Couchbase also has a Docker image.

Couchbase Logo

docker-logo

This blog will explain how you can easily start Couchbase Server 4.0 as a Docker image.

Install and Configure Docker

Docker is natively supported on Linux. So apt get docker-engine on Ubuntu or yum install docker-engine on CentOS will get you ready to use Docker.

On Mac or Windows, this is achieved by installing Docker Machine. Docker Machine to Setup Docker Host explains in detail on how to install and configure Docker Machine.

Here is a brief summary to get you started with Docker:

  1. Download Docker client:
    > curl -L https://get.docker.com/builds/Darwin/x86_64/docker-1.8.3 > /usr/local/bin/docker
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 8664k  100 8664k    0     0  4139k      0  0:00:02  0:00:02 --:--:-- 4139k
    > chmod +x /usr/local/bin/docker
  2. Download Docker Machine script:
    > curl -L https://github.com/docker/machine/releases/download/v0.4.1/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   586    0   586    0     0   1103      0 --:--:-- --:--:-- --:--:--  1103
    100 11.8M  100 11.8M    0     0  2733k      0  0:00:04  0:00:04 --:--:-- 3458k
    > chmod +x /usr/local/bin/docker-machine
  3. Create Docker Machine host:
    > docker-machine create --driver=virtualbox default
    Creating VirtualBox VM...
    Creating SSH key...
    Starting VirtualBox VM...
    Starting VM...
    To see how to connect Docker to this machine, run: docker-machine env default
  4. Setup Docker client to connect to this host:
    > eval $(docker-machine env default)

Now your current shell is configured where the Docker client can run containers on the Docker Machine.

Run Couchbase Docker Container

  1. Starting a Docker container on this machine is pretty straightforward. The CLI downloads the image from Docker Hub and then runs it on the Machine:
    > docker run -d -p 8091:8091 couchbase
    Unable to find image 'couchbase:latest' locally
    latest: Pulling from library/couchbase
    ba2b457ecfb2: Pull complete 
    26180b0fe8fb: Pull complete 
    edd7c1974a70: Pull complete 
    57bca5139a13: Pull complete 
    5eb89c4f7e1a: Pull complete 
    46b6bac823d2: Pull complete 
    6845430f4274: Pull complete 
    92d9ea0b826c: Pull complete 
    c02a4d9a78c4: Pull complete 
    904ac92614ac: Pull complete 
    e924e7d4b1dc: Pull complete 
    bbe8a967cf05: Pull complete 
    35fb2c30481e: Pull complete 
    68eb883fd0c7: Pull complete 
    fe1b3bdb1e2f: Pull complete 
    library/couchbase:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
    Digest: sha256:388b710593a7a643c49bf38c4b16eb8e175dccac093e9aa8dea5bd2e2d326efd
    Status: Downloaded newer image for couchbase:latest
    5b789d2319486ce8a4a4d6a866d8212dde1464601451b9a84a8d3bf80e8aa935

    In this CLI, the run command runs the container using the image id specified as the last argument, -p publish port 8091 from the container to 8091 on the Docker Machine, -d runs the container in the background and prints the container id.
  2. Watch the container status as:
    > docker ps
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                                           NAMES
    5b789d231948        couchbase           "/entrypoint.sh couch"   7 minutes ago       Up 7 minutes        8092/tcp, 11207/tcp, 11210-11211/tcp, 0.0.0.0:8091->8091/tcp, 18091-18092/tcp   sick_yonath
  3. Find out the IP address of the Docker Machine:
    > docker-machine ip default
    192.168.99.100
  4. Access the setup console at 192.168.99.100:8091, make sure to specify the exact IP address in your case. This will show the screen:Couchbase Docker Getting Started 1

Configure Couchbase Server

First run of Couchbase Server requires you to configure it, let's do that next!

  1. Click on the Setup button. Scroll to the bottom of the screen, change the Data RAM Quota to 500 (MB-16530), and click on Next. Couchbase Docker Getting Started 2
  2. In Couchbase, data is stored in buckets. The server comes pre-installed with some sample buckets. Select the travel-sample bucket to install it and click on Next. Couchbase Docker Getting Started 3
  3. Configure the bucket by taking defaults: Couchbase Docker Getting Started 4

    Click on Next.
  4. Enter personal details, agree to T&C, click on Next: Couchbase Docker Getting Started 5
  5. Provide administrator credentials: Couchbase Docker Getting Started 6Click on Next to complete the installation. This brings up Couchbase Web Console:Couchbase Docker Web Console

It takes a few seconds for the travel-sample bucket to be fully loaded. And once that is done, your Couchbase server is ready to roll!

You can also watch the following presentation from Couchbase Connect:

Talk to us at Couchbase Forums or @couchbase.

Docker (software) Couchbase Server Machine

Published at DZone with permission of Arun Gupta, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Your Old Laptop Is Your New Database Server
  • Spinnaker Meets Minikube: Part 1
  • How To Dockerize Mean Stack App
  • Getting Started With Windows Containers

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: