How to write docker-compose file for bbb (big blue button)? - docker

I find a Big Blue Button Dockerfile on [ bigbluebutton /docker ][1] [1]: https://github.com/bigbluebutton/docker
And second week I tryed to write docker-compose.yml file.
How to write docker-compose.yml file. I tried but not success.
This is Dockerfile [ bigbluebutton /docker ][1] [1]: https://github.com/bigbluebutton/docker
FROM ubuntu:16.04
MAINTAINER ffdixon#bigbluebutton.org
ENV DEBIAN_FRONTEND noninteractive
# RUN echo 'Acquire::http::Proxy "http://192.168.0.130:3142";' > /etc/apt/apt.conf.d/01proxy
RUN apt-get update && apt-get install -y wget
RUN echo "deb http://ubuntu.bigbluebutton.org/xenial-200 bigbluebutton-xenial main " | tee /etc/apt/sources.list.d/bigbluebutton.list
RUN wget http://ubuntu.bigbluebutton.org/repo/bigbluebutton.asc -O- | apt-key add -
RUN apt-get update && apt-get -y dist-upgrade
# -- Setup tomcat7 to run under docker
RUN apt-get install -y \
haveged \
net-tools \
supervisor \
sudo \
tomcat7
RUN sed -i 's|securerandom.source=file:/dev/random|securerandom.source=file:/dev/urandom|g' /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
ADD mod/tomcat7 /etc/init.d/tomcat7
RUN chmod +x /etc/init.d/tomcat7
RUN apt-get install -y language-pack-en
RUN update-locale LANG=en_US.UTF-8
# -- Install BigBlueButton
RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
RUN apt-get install -y bigbluebutton
RUN apt-get install -y bbb-demo
# -- Install mongodb (for HTML5 client)
RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
RUN echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
RUN sudo apt-get update && sudo apt-get install -y mongodb-org curl
# -- Install nodejs (for HTML5 client)
RUN apt-get install -y apt-transport-https
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN echo 'deb http://deb.nodesource.com/node_8.x xenial main' > /etc/apt/sources.list.d/nodesource.list
RUN echo 'deb-src http://deb.nodesource.com/node_8.x xenial main' >> /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install -y nodejs
# -- Install HTML5 client
RUN apt-get install -y bbb-html5
# -- Install supervisor to run all the BigBlueButton processes (replaces systemd)
RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# -- Modify FreeSWITCH event_socket.conf.xml to listen to IPV4
ADD mod/event_socket.conf.xml /opt/freeswitch/etc/freeswitch/autoload_configs
# -- Finish startup
ADD setup.sh /root/setup.sh
ENTRYPOINT ["/root/setup.sh"]
CMD []
So this is my docker-compose file. But that file not worked. I lack knowledge and qualification.
version: '3'
services:
bigbluebutton:
build: .
image: bigbluebutton/bigbluebutton
ports:
- "80:80"
expose:
- "1935/tcp"
- "5066/tcp"
- "2202"
Thanks for your answers.

just you need lines below in Docckerfiles becuse bbb need configure and this code passing this step;
`-RUN apt-get install -y bigbluebutton(remove)
+RUN apt-get install -y bigbluebutton || :
+RUN gem install bundler -v 1.16.1
+RUN apt-get install -y bigbluebutton
RUN apt-get install -y bbb-demo`
this is not bug just compile error.

I think you did not indent correctly expose subsection. I would write:
version: '3'
services:
bigbluebutton:
build: .
image: bigbluebutton/bigbluebutton
ports:
- "80:80"
expose:
- "1935/tcp"
- "5066/tcp"
- "2202"
If you use bigbluebutton/bigbluebutton image from DockerHub, you don't need neither build section nor Dockerfile itself.

Related

Can't access port 8080, 50000 and 8888 while installing jenkins and jupyter

I am new to dokers. I need jenkins and jupyter notebook in the same container. I have written the following Dockerfile but I can't access localhost:8888 or 8080 or 50000 when I run this image. However, these ports work very well when I run the official jenkins image. So, I don't know where I am making the mistake in my Dockerfile.
# using ubuntu as base image
FROM ubuntu:20.04
# installing python version 3.8
RUN apt-get update -y \
&& apt-get install -y apt-utils \
&& apt-get install python3.8 -y
# installing jupyter notebook
RUN apt-get install jupyter -y
EXPOSE 8888
# installing jenkins
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install dialog apt-utils -y
RUN apt-get update && apt-get install -y gnupg2
RUN apt-get install -y wget
RUN wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | apt-key add -
RUN sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
/etc/apt/sources.list.d/jenkins.list'
RUN apt-get update
RUN apt-get install jenkins -y
EXPOSE 50000 8080
# removing unnecessary files
RUN rm -rf /var/lib/apt/lists/*
COPY sample.py .
LABEL maintainer=Ammar
CMD ["bash"]

Speed up image building docker with docker compose

i am a newby in docker and I need an installation based on ubuntu of logstash.
I try the official logstash image and without success I can't run it so I decided to build my own installation based on my needs.
It works well but takes a lot of time to build it.
I wonder how can I improve (speed up) my building
This is my Dockerfile
FROM ubuntu:18.04
# RUN adduser --disabled-password --gecos "" ubuntu
# RUN usermod -aG sudo ubuntu
# RUN echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN apt-get update && \
apt-get autoclean && \
apt-get autoremove
RUN echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
RUN apt-get install curl ca-certificates apt-utils wget apt-transport-https default-jre gnupg apt-transport-https software-properties-common -y
# RUN update-alternatives --config java
ENV LANG C.UTF-8
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
ENV PATH $JAVA_HOME/bin:$PATH
RUN wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
RUN apt update
RUN apt install ruby-full -y
RUN ruby --version
RUN apt install jruby -y
#install jruby (last version)
RUN jruby --version
RUN apt install logstash
#install plugins and bundles.
RUN cd /usr/share/logstash && gem install bundler
COPY logstash-pcap-test.conf /usr/share/logstash/
RUN mkdir /home/logstash/ && mkdir /home/logstash/traffic
COPY /traffic-example/* /home/logstash/traffic/
WORKDIR /usr/share/logstash
CMD ["/bin/bash","-c","bin/logstash -f logstash-pcap-test.conf --config.reload.automatic"]
And this is my docker-compose
version: "3"
services:
logstash_test:
build:
context: .
dockerfile: container/Dockerfile
image: logstash_test:latest
container_name: logstash_test
hostname: logstash_test
ports:
- 9600:9600
- 8089:8089
networks:
- elknetwork
networks:
elknetwork:
driver: bridge
Any thoughts?

Docker Debian nc command not found

When I build my Debian image from docker-compose, with the command $ docker-compose -f docker-compose-dev.yml build web, like so:
docker-compose-fev.yml
services:
web:
build:
context: ./services/web
dockerfile: Dockerfile-dev
volumes:
- './services/web:/usr/src/app'
ports:
- 5001:5000
environment:
- FLASK_ENV=development
- APP_SETTINGS=project.config.DevelopmentConfig
- DATABASE_URL=postgres://postgres:postgres#web-db:5432/web_dev
- DATABASE_TEST_URL=postgres://postgres:postgres#web-db:5432/web_test
- SECRET_KEY=my_precious
depends_on:
- web-db
- redis
As though it appears to build all packages successfully, I'm getting:
web_1| /usr/src/app/entrypoint.sh: 5: /usr/src/app/entrypoint.sh: nc: not found
If I change #!/bin/sh to #!/bin/bash, error log changes:
web_1| /usr/src/app/entrypoint.sh: line 5: nc: command not found
Dockerfile:
FROM python:3.7-slim-buster
RUN apt-get update && apt-get -y dist-upgrade
RUN apt-get -y install build-essential libssl-dev libffi-dev libblas3 libc6 liblapack3 gcc python3-dev python3-pip cython3
RUN apt-get -y install python3-numpy python3-scipy
# set working directory
WORKDIR /usr/src/app
COPY ./requirements.txt /usr/src/app/requirements.txt
RUN pip3 install -r requirements.txt
# add entrypoint.sh
COPY ./entrypoint.sh /usr/src/app/entrypoint.sh
RUN chmod +x /usr/src/app/entrypoint.sh
# add app
COPY . /usr/src/app
# run server
CMD ["/usr/src/app/entrypoint.sh"]
entrypoint.sh
#!/bin/sh
echo "Waiting for postgres..."
while ! nc -z web-db 5432; do
sleep 0.1
done
rm -rf celery_logs/*
echo "PostgreSQL started"
python manage.py run -h 0.0.0.0
Note: this entrypoint configuration used to work with Alpine, and now has changed to Debian.
what am I missing?
Update the Dockerfile and append,
RUN apt install -y netcat
It should be like,
FROM python:3.7-slim-buster
RUN apt-get update && apt-get -y dist-upgrade
RUN apt-get -y install build-essential libssl-dev libffi-dev libblas3 libc6 liblapack3 gcc python3-dev python3-pip cython3
RUN apt-get -y install python3-numpy python3-scipy
RUN apt install -y netcat

Laravel dusk tests in gitlab with docker - Failed to connect to localhost port 9515: Connection refused

When running laravel-dusk on in a docker container on gitlab I get an error saying it cannot connect to port 9515 on localhost.
Failed to connect to localhost port 9515: Connection refused
My docker file looks as following:
# Set the base image for subsequent instructions
FROM php:7.1
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Install packages
RUN apt-get update -yqq && apt-get install -y git wget curl libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev -yqq bzip2 libfontconfig xvfb chromium libmagickwand-dev
# Add chrome repo and install google-chrome-stable
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get update
RUN apt-get install -y google-chrome-stable
# Install php environment
RUN docker-php-ext-install mbstring mcrypt pdo_mysql curl json intl gd xml zip bz2 opcache bcmath
# Install imagick
RUN pecl install imagick && docker-php-ext-enable imagick
# check installed modules
RUN php -m
# Install NVM
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 8.1.4
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
# install node and npm
RUN source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
# add node and npm to path so the commands are available
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# Install Composer Package manager
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php \
php -r "unlink('composer-setup.php');" && mv composer.phar /usr/local/bin/composer
# Update packages
RUN apt-get update
# Xdebug
RUN pecl install -o -f xdebug \
&& rm -rf /tmp/* \ && docker-php-ext-enable xdebug
# Clear out the local repository of retrieved package files
RUN apt-get clean
# Install Laravel Envoy
RUN composer global require "laravel/envoy=~1.0"
# confirm installed versions
RUN node -v
RUN npm -v
RUN php -v
RUN google-chrome-stable --version
RUN composer --version
RUN php -m
EXPOSE 9515
Then my gitlab-ci file looks like the following:
image: registry.gitlab.com/path-to-repo/repo-name:latest
# Select what we should cache
cache:
paths:
- vendor/
services:
- mysql:5.7
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: database-name
MYSQL_ROOT_PASSWORD: database-password
DB_HOST: mysql
DB_USERNAME: root
stages:
- test
unit_test:
stage: test
script:
- cp .env.runnable .env
- composer install
- php artisan config:clear
- php artisan key:generate
- php artisan migrate --seed
- php artisan db:seed --class=TestSeeder
- vendor/bin/phpunit --coverage-text --colors=never
- php artisan env
- php artisan dusk
At first I thought it was because I was not exposing port 9515, but I have exposed this in the Dockerfile. However, now I have no idea what the problem could be. Is there an issues that this port is used for another process? Could it be that the Chromedriver is running on a different port?
In your gitlab-ci file try to replace php artisan dusk with:
php artisan serve & php artisan dusk
I was getting the 9515 connection refused error and then I found this GitHub issue and added these dependencies to my dockerfile (granted Im using custom ubuntu image). I didn't need to add anything else that the GitHub comment mentions (no script etc).
FROM ubuntu:18.04
# ... my other previous dependencies (PHP, etc.)
RUN apt-get update && \
apt-get -y install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 && \
apt-get -y install chromium-browser && \
apt-get -y install xvfb gtk2-engines-pixbuf && \
apt-get -y install xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable && \
apt-get -y install imagemagick x11-apps && \
apt-get upgrade -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
Also, for local development I needed to update my .env (or use .env.dusk.local) APP_URL: to point to my docker host.
APP_URL=host.docker.internal:8000
For GitLab, you can try and update your .env APP_URL with the docker host by adding an additional setup in a before_script (after copying .env.example to .env). (host.docker.internal is not available in docker for linux). Also, Note your container will need net-tools for the netstat command.
before_script:
# ...
- docker_host=$(netstat -nr | grep '^0\.0\.0\.0' | awk '{print $2}') && sed -i "s|APP_URL=http://0.0.0.0|APP_URL=http://${docker_host}|" .env
Where APP_URL=http://0.0.0.0 is the value of what is already in your existing .env file.

Creating MongoDB image error from Docker official tutorial

Here is the official tutorial to create mongoDB img.
I followed exactly the tutorial and generated the following Dockerfile
# https://docs.docker.com/engine/examples/mongodb/#creating-a-dockerfile-for-mongodb
# Dockerizing MongoDB: Dockerfile for building MongoDB images
# Based on ubuntu:latest, installs MongoDB following the instructions from:
# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
# Format: FROM repository[:version]
FROM ubuntu:latest
# Installation:
# Import MongoDB public GPG key AND create a MongoDB list file
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
RUN apt-get install -y --no-install-recommends software-properties-common
RUN echo "deb http://repo.mongodb.org/apt/ubuntu $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
# Update apt-get sources AND install MongoDB
RUN apt-get update && apt-get install -y mongodb-org
# MongoDB requires a data directory. Let’s create it as the final step of our installation instructions.
# Create the MongoDB data directory
RUN mkdir -p /data/db
# Expose port 27017 from the container to the host
EXPOSE 27017
# Set usr/bin/mongod as the dockerized entry-point application
ENTRYPOINT ["/usr/bin/mongod"]
But when I execute
$ docker build --tag my/repo .
I got the following error:
What is going on? Why it fails? How to fix it?
EDIT:
After adjust the command order, my final script is this:
# Format: FROM repository[:version]
FROM ubuntu:latest
# Update apt-get sources AND install MongoDB
RUN apt-get update
# Installation:
# Import MongoDB public GPG key AND create a MongoDB list file
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
RUN apt-get install -y --no-install-recommends software-properties-common
# RUN echo "deb http://repo.mongodb.org/apt/ubuntu $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
RUN echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
RUN apt-get install -y mongodb-org
# MongoDB requires a data directory. Let’s create it as the final step of our installation instructions.
# Create the MongoDB data directory
RUN mkdir -p /data/db
# Expose port 27017 from the container to the host
EXPOSE 27017
# Set usr/bin/mongod as the dockerized entry-point application
ENTRYPOINT ["/usr/bin/mongod"]
Then I got the following error:
Next, then I added "RUN apt-get install sudo", then I got the following error:
3 strikes down, I am not confident this whole thing will work. Here is my final Dockerfile.
# https://docs.docker.com/engine/examples/mongodb/#creating-a-dockerfile-for-mongodb
# Dockerizing MongoDB: Dockerfile for building MongoDB images
# Based on ubuntu:latest, installs MongoDB following the instructions from:
# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
# Format: FROM repository[:version]
FROM ubuntu:latest
# Update apt-get sources AND install MongoDB
RUN apt-get update
# Installation:
# Import MongoDB public GPG key AND create a MongoDB list file
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
RUN apt-get install -y --no-install-recommends software-properties-common
RUN apt-get install sudo
# RUN echo "deb http://repo.mongodb.org/apt/ubuntu $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
RUN echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
RUN apt-get install -y mongodb-org
# MongoDB requires a data directory. Let’s create it as the final step of our installation instructions.
# Create the MongoDB data directory
RUN mkdir -p /data/db
# Expose port 27017 from the container to the host
EXPOSE 27017
# Set usr/bin/mongod as the dockerized entry-point application
ENTRYPOINT ["/usr/bin/mongod"]
If you can make it work, please paste your Dockerfile and I'd love to learn what is wrong in my script. I followed the tutorial and it doesn't work.
A quick google search for your exact error message found this.
This is an error from apt saying it can't find the software-properties-common package in its repositories. When a package change be found, it usually means apt needs updating.
You are running apt-get update but you're running it after the update line.
RUN apt-get install -y --no-install-recommends software-properties-common
...
RUN apt-get update && apt-get install -y mongodb-org
Instead, run it first
RUN apt-get update
RUN apt-get install -y --no-install-recommends software-properties-common
...
RUN apt-get install -y mongodb-org
Update: Your update says you're now getting an error when installing the mongodb package. This is because you've loaded a deb package file and need to update apt yet again so that it knows about it. At this point, the easiest thing to do is just prefix any apt-get commands that complain about not finding packages with an update.
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common
...
RUN apt-get update && apt-get install -y mongodb-org

Resources