skip to Main Content

New to this so not sure what I’m missing.

I’m trying to follow these instructions to install elabftw as a docker container: https://doc.elabftw.net/install-nas.html

this is the container: https://registry.hub.docker.com/r/elabftw/elabimg/

Edited the docker-compose.yml but can’t seem to run

docker-compose up -d

bash: docker-compose: command not found 

I thought docker-compose already comes installed?

I’d appreciate some help!

Thanks
Danny

Update:

Can’t even seem to install docker-container in the actual container

bash-5.1# curl -L https://github.com/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` -o docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   633  100   633    0     0   4645      0 --:--:-- --:--:-- --:--:--  4654
100 11.6M  100 11.6M    0     0  3891k      0  0:00:03  0:00:03 --:--:-- 4083k
bash-5.1# ls
cache  config.php  docker-compose  docker-compose.yml  mysql  uploads  web
bash-5.1# chmod +x docker-compose
bash-5.1# docker-compose --version
bash: docker-compose: command not found
bash-5.1#

I can install docker-container on the actual NAS and update it, but not in the docker container itself.

Edit II: docker-container.yml

# docker-elabftw configuration file
# use : "docker-compose up -d" to start containers
# this config file contains all the possible configuration options, shown with default values
# https://hub.docker.com/r/elabftw/elabimg/
# https://www.elabftw.net
version: '3'

# our first container is nginx + php-fpm + elabftw
services:
  web:
    # the latest tag points to the latest stable version
    # use the next tag to use alpha/beta version
    # use a specific version to pin the image
    # example: elabftw/elabimg:4.0.5
    # default value: elabftw/elabimg:latest
    image: elabftw/elabimg:latest
    # this ensures the container will be restarted after a reboot of the server
    # default value: always
    restart: always
    # comment this out if you use several containers with redis, as you can't have several containers with the same name
    # default value: elabftw
    container_name: elabftw

    # limit number of processes
    pids_limit: 42
    # drop some capabilities not needed by the app
    cap_drop:
        - SYS_ADMIN
        - AUDIT_WRITE
        - MKNOD
        - SYS_CHROOT
        - SETFCAP
        - NET_RAW
        - SYS_PTRACE

    # environment variables passed to the container to configure options at run time (when container is started)
    # commented variables are optional
    environment:
        #######################
        # MYSQL CONFIGURATION #
        #######################
        # name of the MySQL server (by default "mysql" the name of the mysql container in default elabftw Docker configuration)
        # you can put here the IP address of an existing MySQL server if you already have one running
        # default value: mysql
        - DB_HOST=mysql

        # port on which the MySQL server is listening
        # you probably don't need to modify this value
        # default value: 3306
        - DB_PORT=3306

        # name of the MySQL database
        # you probably don't need to modify this value
        # default value: elabftw
        - DB_NAME=elabftw

        # MySQL user with write access to the previously named database
        # you probably don't need to modify this value
        # default value: elabftw
        - DB_USER=elabftw

        # MySQL password; a random password has been generated for you but feel free to change it if needed
        # default value: generated randomly if you get the config from get.elabftw.net
        - DB_PASSWORD=

        # Mysql Cert path: you only need this if you connect to a mysql server with tls
        # Use a volume that points to /mysql-cert in the container
        # optional
        #- DB_CERT_PATH=/mysql-cert/cert.pem

        #####################
        # PHP CONFIGURATION #
        #####################
        # the timezone in which the server is
        # better if changed (see list of available values: http://php.net/manual/en/timezones.php
        - PHP_TIMEZONE=Europe/Paris
        # again
        - TZ=Europe/Paris

        # optional: set the limit of simultaneous request that will be server
        # see http://php.net/manual/en/install.fpm.configuration.php
        # default value: 50
        #- PHP_MAX_CHILDREN=50

        # optional: adjust the max execution time of PHP scripts. Allows for bigger ZIP exports.
        # default value: 120
        #- PHP_MAX_EXECUTION_TIME=120

        # optional: adjust the amount of memory available to PHP, increase it if you run into memory issues due to the size of your database
        # default value: 256M
        #- MAX_PHP_MEMORY=256M

        #########################
        # ELABFTW CONFIGURATION #
        #########################
        # The secret key is used for encrypting the SMTP password
        # A random one has been generated for you, if you wish to change it you can
        # get your secret key from https://demo.elabftw.net/install/generateSecretKey.php
        # if you don't want to get it from an external source you can also do that:
        # docker run --rm -t --entrypoint '/bin/sh' elabftw/elabimg -c "php /elabftw/web/install/generateSecretKey.php"
        # default value: generated randomly if you get the config from get.elabftw.net
        - SECRET_KEY=def00000becc6e2c28e5dfd0f4728d5dc0f6d1f4244783e241e567a3860a6b4c01469042e6a9ebdc278d1ed026d8a0be1ce6b0c2c30891069daedbb01256d69adc42a0be

        # optional: adjust maximum size of uploaded files
        # default value: 100M
        #- MAX_UPLOAD_SIZE=100M

        #######################
        # NGINX CONFIGURATION #
        #######################
        # change to your server name in nginx config
        # default value: localhost
        # example value: elab.uni.edu
        - SERVER_NAME=localhost

        # optional: disable https, use this to have an http server listening on port 443
        # useful if the SSL stack is handled by haproxy or something alike
        # default value: false
        - DISABLE_HTTPS=true

        # set to true to use letsencrypt or other certificates
        # note: does nothing if DISABLE_HTTPS is set to true
        # default value: false
        - ENABLE_LETSENCRYPT=false

        # optional: enable ipv6 (make sure you have an AAAA dns record!)
        # default value: false
        #- ENABLE_IPV6=false

        # optional: adjust the user/group that will own the uploaded files
        # useful in very particular situations, like with NFSv4
        # you don't really need to change this in most situations
        # so this is left commented (default values are shown)
        # default value: nginx
        #- ELABFTW_USER=nginx
        # default value: nginx
        #- ELABFTW_GROUP=nginx
        # default value: 101
        #- ELABFTW_USERID=101
        # default value: 101
        #- ELABFTW_GROUPID=101

        # optional: enable if you want nginx to be configured with set_real_ip_from directives
        # default value: false
        #- SET_REAL_IP=false
        # the IP address/addresses. Separate them with a , AND A SPACE. Several set_real_ip_from lines will be added to the nginx config. One for each.
        # this does nothing if SET_REAL_IP is set to false
        #- SET_REAL_IP_FROM=192.168.31.48, 192.168.0.42, 10.10.13.37

        # optional: adjust the number of worker processes nginx will spawn
        # default value: auto
        # if auto doesn't work for you, use the number of cores available on the server (or less)
        #- NGINX_WORK_PROC=auto

        #######################
        # REDIS CONFIGURATION #
        #######################
        # optional: use a redis server to store the PHP sessions
        # default value: false
        #- USE_REDIS=false
        # optional: set an IP or hostname for the redis server
        # default value: redis
        #- REDIS_HOST=redis
        # optional: set a custom port for redis
        # default value: 6379
        #- REDIS_PORT=6379

        #################
        # MISCELLANEOUS #
        #################
        # optional: be less verbose during init
        # default value: false
        #- SILENT_INIT: false

        #######
        # DEV #
        #######
        # set to true for development
        # default value: false
        #- DEV_MODE: false

    ports:
        # if you want elabftw to run on a different port, change the first number
        # host:container
        - '3148:443'
        # if you are aiming for running multiple instances of this container you can put a range like so:
        # - "3100-3200:443"
        # use redis for session storage if that is the case, or configure your load balancer with sticky sessions
    volumes:
        # this is where you will keep the uploaded files persistently
        # for Windows users it might look like this
        # - D:UsersNicoelab-dataweb:/elabftw/uploads
        # host:container
        - /volume1/docker/Container/elabftw/web:/elabftw/uploads
        #
        # TLS configuration
        #
        # Note: if your certificate is not from letsencrypt, make sure to have those two files:
        #
        #       /etc/letsencrypt/live/SERVER_NAME/fullchain.pem
        #       /etc/letsencrypt/live/SERVER_NAME/privkey.pem
        #
        # in the folder /etc/letsencrypt (or any folder you like as long as you adapt the line below
        # replace SERVER_NAME with the value of SERVER_NAME of course.
        #
        # if you have enabled letsencrypt, uncomment the line below
        # path to the folder with TLS certificate + private key
        # host:container
        #- /etc/letsencrypt:/ssl
        #
        # MYSQL cert path
        #- /path/to/cert/folder:/mysql-cert

    networks:
      - elabftw-net

  # the mysql database image
  # Note: if you already have a MySQL server running, you don't need to use this image, as you can use the already existing one
  # In this case, add the IP address of the server in DB_HOST and comment out or remove this block
  mysql:
    image: mysql:8.0
    restart: always
     # fix issue with "The server requested authentication method unknown to the client [caching_sha2_password]"
    command: --default-authentication-plugin=mysql_native_password
    container_name: mysql
    # drop some capabilities
    cap_drop:
        - AUDIT_WRITE
        - MKNOD
        - SYS_CHROOT
        - SETFCAP
        - NET_RAW
    cap_add:
        - SYS_NICE
    environment:
        # need to change
        - MYSQL_ROOT_PASSWORD=X54DtNOryK2flSYOIo2raoc4m0qUQ90
        # no need to change
        - MYSQL_DATABASE=elabftw
        # no need to change
        - MYSQL_USER=elabftw
        # need to change IMPORTANT: this should be the same password as DB_PASSWORD from the elabftw container
        - MYSQL_PASSWORD=
        # need to change, this is your timezone, see PHP_TIMEZONE from the elabftw container
        - TZ=Europe/Paris

    volumes:
        # this is where you will keep the database persistently
        # for Windows users it might look like this
        # - D:UsersNicoelab-datamysql:/var/lib/mysql
        # host:container
        - /var/elabftw/mysql:/var/lib/mysql
    expose:
      - '3306'
    networks:
      - elabftw-net

  # example of a redis container
  # uncomment if you want to spawn a redis container to manage sessions
  #redis:
  #  image: redis:6.0-alpine
  #  restart: always
  #  container_name: redis
  #  networks:
  #    - elabftw-net

  ###############################################################
  # EVERYTHING BELOW THIS LINE IS FOR DEVELOPMENT PURPOSES ONLY #
  ###############################################################

  # PHPMYADMIN
  # uncomment this part if you want to have phpmyadmin running too
  #phpmyadmin:
  #    image: phpmyadmin/phpmyadmin
  #    container_name: phpmyadmin
  #    environment:
  #        - PMA_PORT=3307
  #    links:
  #        - mysql:db
  #    ports:
  #        - "8080:80"
  #    networks:
  #        - elabftw-net

  # LDAP
  # example for ldap server + admin interface
  # uncomment if you want to work on LDAP authentication
  #ldap:
  #    image: osixia/openldap:1.4.0
  #    container_name: ldap
  #    restart: always
  #    hostname: example.org
  #    environment:
  #      - LDAP_TLS_VERIFY_CLIENT=try
  #      - LDAP_OPENLDAP_UID=1000
  #      - LDAP_OPENLDAP_GID=1000
  #    ports:
  #      - "389:389"
  #      - "636:636"
  #    volumes:
  #      - /var/elabftw/ldap-data/ldap:/var/lib/ldap
  #      - /var/elabftw/ldap-data/slapd.d:/etc/ldap/slapd.d
  #    networks:
  #        - elabftw-net
  #ldapadmin:
  #    image: osixia/phpldapadmin:0.9.0
  #    container_name: ldapadmin
  #    environment:
  #      - PHPLDAPADMIN_LDAP_HOSTS=ldap
  #    restart: always
  #    ports:
  #      - "6443:443"
  #    networks:
  #        - elabftw-net

# the internal elabftw network
networks:
  elabftw-net:

2

Answers


  1. It means that docker-compose is not installed.
    You should to try to install it first then install docker-compose.
    https://docs.docker.com/get-docker/

    https://docs.docker.com/compose/install/

    Login or Signup to reply.
  2. You should execute that command in sudo mode.

    sudo -i
    # enter password
    
    docker-compose up -d
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search