Image COUCHBASE

STARTX Profile licence Sources

last commit Build Status Dockerhub Registry Docker couchbase pulls Docker Repository on Quay

Simple container used to deliver distributed and low latency document oriented database Run couchbase daemon under a container based on startx/fedora container

Startx couchbase is a base container used for deliver distributed and low latency document oriented database published in Dockerhub registry and Quay registry. This container contain :

  • fedora / centos /alpine /ubi operating system
  • core OS packages (kernel, libs) updated every week
  • fundamentals tools (ex: pwgen, tar, zip) updated every week
  • usefull tools (psmisc, procps, coreutils, findutils, wget, curl, vi, bash-completion) only for the :latest flavour.
  • Couchbase NoSQL server and tools (couchbase release depend on the flavour you use, see container flavours for more information)

You can use Startx couchbase image in many ways :

See more applications builders and sample on startx docker images repository

Container flavours

Docker Hub repository Content Couchbase
startx/sv-couchbase:latest Fedora core rawhide 6.6.2-9588
startx/sv-couchbase:35 Fedora core 35 6.6.2-9588
startx/sv-couchbase:34 Fedora core 34 6.6.1-9213
startx/sv-couchbase:33 Fedora core 33 6.6.0-7909
startx/sv-couchbase:32 Fedora core 32 6.0.2-2413
startx/sv-couchbase:31 Fedora core 31 6.6.2-9588
startx/sv-couchbase:30 Fedora core 30 6.0.0
startx/sv-couchbase:29 Fedora core 29 5.5.0-beta
startx/sv-couchbase:28 Fedora core 28 4.5.0
startx/sv-couchbase:27 Fedora core 27 4.5.0
startx/sv-couchbase:26 Fedora core 26 2.4.17
startx/sv-couchbase:centos8 Centos 8 6.5.1-6299
startx/sv-couchbase:centos7 Centos 7 6.0.5-3340
startx/sv-couchbase:centos6 Centos 6 5.5.0-2958
startx/sv-couchbase:ubi8 RedHat UBI 8 6.6.2-9588

Running this image

If you want to be guided on setting-up and installing various containers engines (docker, podman, s2i, dockerEE, kubernetes, openshift) you can read ours containers engines guidelines.

Running using docker

docker run -it -p 9201:8080 --name="example-couchbase" startx/sv-couchbase
  • Connect to your local application
firefox http://localhost:9201

Running using docker-compose

  • Create a docker-compose.yml file with the following content
service:
  image: startx/sv-couchbase:latest
  container_name: "service-couchbase"
  volumes:
    - "/tmp/container/couchbase/logs:/logs:z"
    - "/tmp/container/couchbase/data:/data:z"
  • Execute the following command
docker-compose up -d
docker-compose logs
  • Connect to your local application
firefox http://localhost:9201

Running using Openshift

Openshift images streams

Openshift cluster administrator can offer this image and all its flavour to all consumers. You can import our openshift images stream in your openshift project.

You must be cluster-admin to add this image to the openshift project. If not, you can add it to your own project (skip the oc project openshift command in the next script)

# swith to the openshift project
oc project openshift
# Add image streams to the service catalog (project or cluster-wide scope)
oc create -f https://raw.githubusercontent.com/startxfr/docker-images/master/Services/couchbase/openshift-imageStreams.yml

Openshift builder template

Openshift cluster administrator can add a build and deploy template to their consumers. As an administrator, you can import our openshift builder template in your openshift project.

You must be cluster-admin to add this image to the openshift project. If not, you can add it to your own project (skip the oc project openshift command in the next script)

# swith to the openshift project
oc project openshift
# Add this template to the service catalog (project or cluster-wide scope)
oc create -f https://raw.githubusercontent.com/startxfr/docker-images/master/Services/couchbase/openshift-template-build.yml

You can then build an application

# create an example project
oc new-project example
# start a new application
oc process -f startx-couchbase-build-template \
    -p APP_NAME=myapp \
| oc create -f -

Openshift deploy template

Openshift cluster administrator can add a deploy template to their consumers. As an administrator, you can import our openshift deploy template in your openshift project.

You must be cluster-admin to add this image to the openshift project. If not, you can add it to your own project (skip the oc project openshift command in the next script)

# swith to the openshift project
oc project openshift
# Add this template to the service catalog (project or cluster-wide scope)
oc create -f https://raw.githubusercontent.com/startxfr/docker-images/master/Services/couchbase/openshift-template-deploy.yml

You can then deploy an application

# create a example project
oc new-project example
# start a new application
oc process -f startx-couchbase-deploy-template \
    -p APP_NAME=myapp \
| oc create -f -

Using this image as S2I builder

You can use this image as an s2i builder image.

s2i build https://gitlab.com/startx1/containers-example-couchbase startx/sv-couchbase test-couchbase
docker run --rm -i -t test-couchbase

Docker-compose in various situations

  • sample docker-compose.yml linked to host port 1000
service:
  image: startx/sv-couchbase:latest
  container_name: "service-couchbase"
  ports:
    - "1000:11211"
  • sample docker-compose.yml with port exposed only to linked services
service:
  image: startx/sv-couchbase:latest
  container_name: "service-couchbase"
  expose:
    - "11211"

Using this image as base container

You can use this Dockerfile template to start a new personalized container based on this container. Create a file named Dockerfile in your project directory and copy this content inside. See docker guide for instructions on how to use this file.

FROM quay.io/startx/couchbase:latest
#... your container specifications
CMD ["/bin/sx", "run"]

Testing the service

access to the running couchbase daemon with telnet localhost 11211; stats. Change port and hostname according to your current configuration

Environment variable

This container is based on startx fedora container who came with some predefined environment variable

Variable Type Mandatory Description
base image environement see environment list
SX_VERSION string latest container version
SX_TYPE string service Container family (os, service, application). could be enhanced
SX_SERVICE string couchbase Define the type of service or application provided
SX_ID auto startx/sv-couchbase Container ID coresponding to the image repository
SX_NAME auto yes Container name
SX_SUMMARY auto yes Container purpose description
SX_VERBOSE bool no Display information about the execution
SX_DEBUG bool no Display debug informations during execution
APP_PATH string /app Path to the application
APP_PORT string 8080 Port to the application
LOG_PATH string /var/log/httpd Destination path to the log produced by the webserver
SX_S2IDIR string /tmp Destination path to the application pushed via s2i process

Exposed port

Port Description
11211 standard couchbase network port used for key/value recovery

Exposed volumes

Container directory Description
/logs log directory used to record container and couchbase logs
/data data directory served by couchbase. If empty will be filled with app on startup.

Container command

Variable Description
assemble Execute the build script on \$APP_PATH application
post-build Execute the post-build script
pre-deploy Execute the pre-deployment script
post-deploy Execute the post-deployment script
run Start the application
isLive Execute the liveness-probe script
isReady Execute the readyness-probe script
info Get information about the sx-couchbase script
usage Get the usage message
version Get information about the sx-couchbase version

For advanced users

You want to use this container and code to build and create locally this container, follow theses instructions.

This section will help you if you want to :

  • Get latest version of this service container
  • Enhance container content by adding instruction in Dockefile before build step

You must have a working environment with the source code of this repository. Read and follow how to setup your working environment to get a working directory. The following instructions assume you are at the top level of your working directory.

Build & run a container using docker

  1. Jump into the container directory with cd Services/couchbase
  2. Build the container using docker build -t sv-couchbase .
  3. Run this container
  4. Interactively with docker run -p 11211:11211 -v /logs -it sv-couchbase. If you add a second parameter (like /bin/bash) to will run this command instead of the default entrypoint. Usefull to interact with this container (ex: /bin/bash, /bin/ps -a, /bin/df -h,...)
  5. As a daemon with docker run -p 11211:11211 -v /logs -d sv-couchbase

Build & run a container using docker-compose

  1. Jump into the container directory with cd Services/couchbase
  2. Run this container
  3. Interactively with docker-compose up Startup logs appears and escaping this command stop the container
  4. As a daemon with docker-compose up -d. Container startup logs can be read using docker-compose logs

If you experience trouble with port already used, edit docker-compose.yml file and change port mapping