[Gambas-user] Docker image Gambas issue

Linus olivier.cruilles at yahoo.fr
Wed Feb 14 16:29:21 CET 2024


Hello Benoit,

I'm currently trying to create a Docker image based on Ubuntu 20.10LTS + Gambas Daily packages.

The goal is to run into a Docker a Gambas Web application build with gb.web.gui

The creation of the Docker image is simple but I'm facing a big bug when running the Web App:
-> The Web App in Gambas start by consumming all the memory of my PC and it is killed by the system due to full memory consumption.

Can you help me on that because it could be very cool if it work into a Docker Image ?



Procedure to reproduce the issue:

1 - Extract the archive file to build the Docker Image

2 - Open a terminal and move into the directory created

  -> cd <path of dir>/Docker_image/

            -> app/
                  -> WebUI.gambas
            -> config/
            -> docker_command.txt
            -> Dockerfile

3 - Build the Docker Image

      -> Dockerfile

<------------------------------------------------------------>
$ cat Dockerfile 

# syntax=docker/dockerfile:1
#
# Dockerfile for Gambas Web Application

FROM ubuntu:focal-20240123

# set version label
ARG BUILD_DATE
ARG VERSION
ARG GAMBAS_VERSION
LABEL maintainer="Olivier Cruilles"

RUN \
  echo "**** install packages ****"

RUN DEBIAN_FRONTEND=noninteractive \
  apt-get update \
  && ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime \
  && export DEBIAN_FRONTEND=noninteractive \
  && apt-get install -y tzdata \
  && dpkg-reconfigure --frontend noninteractive tzdata \
  && apt-get install -y software-properties-common \
  && add-apt-repository ppa:gambas-team/gambas-daily \
  && apt-get update \
  && apt install -y gambas3-gb-web-gui \
      gambas3-gb-util \
      gambas3-runtime \
      gambas3-gb-crypt \
      gambas3-gb-args \
      gambas3-gb-db \
      gambas3-devel \
      gambas3-gb-net \
      gambas3-gb-db-sqlite3 \
      gambas3-gb-httpd \
      gambas3-gb-settings \
      gambas3-gb-signal \
      gambas3-gb-compress \
      gambas3-gb-pcre \
      gambas3-gb-web \
      gambas3-gb-image \
      gambas3-gb-net-curl \
      gambas3-gb-util-web \
 && rm -rf /var/lib/apt/lists/* \
 && echo "**** packages installed ****"

# ports and volumes
EXPOSE 8890:80

VOLUME /config /app

CMD touch /config/webui.log && GB_HTTPD_PORT=80 gbr3 -H /app/WebUI.gambas

<-------------------------------------------------->

      -> docker build -t personal/gambas:202402 <path of dir>/Docker_image/

4 - Start the Docker container manually (for debug)

      -> cd <path of dir>/Docker_image/
      -> docker run -ti  --name webui -v ./config:/config -v ./app:/app personal/gambas:202402 /bin/bash

5 - Once you are logged into the Docker container, start the Web app to reproduce the error

      -> root at 0c98f96c4ef5:/# cd /app
      -> root at 0c98f96c4ef5:/app# GB_HTTPD_PORT=80 gbr3 -H WebUI.gambas

      -> You should see the memory of your host PC increasing rapidly, so CTRL+C to stop it before it freeze your PC

Log of the 'strace' command when 'gbr3 -H WebUI.gambas' is running into the Container:

      -> export GB_HTTPD_PORT=80
      -> strace gbr3 -H WebUI.gambas

...
...
...
sysinfo({uptime=35853, loads=[40640, 28480, 33664], totalram=33591668736, freeram=378462208, sharedram=244621312, bufferram=54444032, totalswap=2147479552, freeswap=2145644544, procs=2341, totalhigh=0, freehigh=0, mem_unit=1}) = 0
getuid()                                = 0
setgroups(0, NULL)                      = 0
setgid(65534)                           = 0
openat(AT_FDCWD, 0x7f75a8122b4a, O_RDONLY) = 12
read(12, 0x7ffeac3aa260, 31)            = 6
close(12)                               = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 12
connect(12, 0x7ffeac3a9ef0, 110)        = -1 ENOENT (No such file or directory)
close(12)                               = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 12
connect(12, 0x7ffeac3aa0e0, 110)        = -1 ENOENT (No such file or directory)
close(12)                               = 0
openat(AT_FDCWD, 0x7f75a7c1317e, O_RDONLY|O_CLOEXEC) = 12
lseek(12, 0, SEEK_CUR)                  = 0
fstat(12, 0x7ffeac3a9bc0)               = 0
read(12, 0x55f217c953c0, 4096)          = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
lseek(12, 0, SEEK_CUR)                  = 557
read(12, "", 4096)                      = 0
close(12)                               = 0
openat(AT_FDCWD, 0x7f75a818ab80, O_RDONLY|O_CLOEXEC) = 12
fstat(12, 0x7ffeac3a97f0)               = 0
mmap(NULL, 12558, PROT_READ, MAP_PRIVATE, 12, 0) = 0x7f75a8161000
close(12)                               = 0
openat(AT_FDCWD, 0x55f217c94760, O_RDONLY|O_CLOEXEC) = 12
read(12, 0x7ffeac3a9998, 832)           = 832
fstat(12, 0x7ffeac3a9840)               = 0
mmap(NULL, 244136, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 12, 0) = 0x7f75a6bc4000
mmap(0x7f75a6bca000, 155648, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 12, 0x6000) = 0x7f75a6bca000
mmap(0x7f75a6bf0000, 49152, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 12, 0x2c000) = 0x7f75a6bf0000
mmap(0x7f75a6bfc000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 12, 0x37000) = 0x7f75a6bfc000
close(12)                               = 0
mprotect(0x7f75a6bfc000, 12288, PROT_READ) = 0
munmap(0x7f75a8161000, 12558)           = 0
rt_sigprocmask(SIG_BLOCK, 0x7ffeac3a9f30, 0x7ffeac3aa170, 8) = 0
rt_sigprocmask(SIG_SETMASK, 0x7ffeac3aa170, NULL, 8) = 0
setgroups(1, 0x55f217c945b0)            = 0
setuid(65534)                           = 0
mmap(NULL, 154618822656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(0x561617cb5000)                     = 0x55f217c9e000
mmap(NULL, 154618953728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
write(2, 0x7f75a7c2c000, 10gb.httpd: )            = 10
write(2, 0x7ffeac3a7c50, 37out of memory allocating a connecttab)            = 37
write(2, 0x7f75a815a643, 1
)             = 1
exit_group(1)                           = ?
+++ exited with 1 +++


Attached the Docker config archive

Thank you

Olivier Cruilles



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240214/88316186/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Docker_image.tar.gz
Type: application/x-gzip
Size: 201947 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240214/88316186/attachment-0001.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240214/88316186/attachment-0003.htm>


More information about the User mailing list