How to properly install a database?

Hi all,

I’m trying to run Couchbase with my application on Gitpod, but I can’t understand what is wrong:

Here is my .gitpod.Dockerfile :

FROM ubuntu:20.04

RUN apt-get -qq update && \
apt-get install -yq runit wget chrpath tzdata \
lsof lshw sysstat net-tools numactl bzip2 && \
apt-get autoremove && apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN if [ ! -x /usr/sbin/runsvdir-start ]; then \
    cp -a /etc/runit/2 /usr/sbin/runsvdir-start; \
fi

ENV PATH=$PATH:/opt/couchbase/bin:/opt/couchbase/bin/tools:/opt/couchbase/bin/install
RUN groupadd -g 1000 couchbase && useradd couchbase -u 1000 -g couchbase -M

RUN mkdir -p /tmp/couchbase && \
cd /tmp/couchbase && \
wget https://packages.couchbase.com/releases/7.0.0-beta/couchbase-server-enterprise_7.0.0-beta-ubuntu20.04_amd64.deb && \
dpkg -i ./couchbase-server-enterprise_7.0.0-beta-ubuntu20.04_amd64.deb

RUN sed -i -e '1 s/$/\/docker/' /opt/couchbase/VARIANT.txt


COPY scripts/run /etc/service/couchbase-server/run
RUN chown -R couchbase:couchbase /etc/service

RUN chrpath -r '$ORIGIN/../lib' /opt/couchbase/bin/curl
COPY scripts/start-cb.sh /
RUN chmod 777 start-cb.sh

VOLUME /opt/couchbase/var

And here is my .gitpod.yml :

tasks:
- name: Couchbase
  init:  cd / && ./start-cb.sh
 
 # exposed ports
 ports:
 - port: 8091
   onOpen: open-preview

vscode:
 extensions:
    - redhat.java
    - vscjava.vscode-java-debug
    - vscjava.vscode-java-test
    - pivotal.vscode-spring-boot

Full repo here https://github.com/deniswsrosa/couchbase-gitpod-demo

I simply have no idea what is wrong, locally it works fine. Can you guys give me a hand here?

Couchbase scripts (and the docker image) assume you’re root. Gitpod allows that, but requires to use sudo when you need root access. I’ve filed a PR to your GitHub repo.