Problem with Docker- buid.sh: received: WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string - docker-compose

I ve got a problem when running $ ./docker-build.sh I receive the following Warnings.
WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string.
WARNING: The HTTPS_HOST variable is not set. Defaulting to a blank string.
WARNING: The HTTP_HOST variable is not set. Defaulting to a blank string.
WARNING: The HTTPS_PORT variable is not set. Defaulting to a blank string.
WARNING: The HTTP_PORT variable is not set. Defaulting to a blank string.
WARNING: The LETSENCRYPT_MODE variable is not set. Defaulting to a blank string.
WARNING: The ADMIN_EMAIL variable is not set. Defaulting to a blank string.
WARNING: The POSTGRESQL_MAX_CONNECTIONS variable is not set. Defaulting to a blank string.
WARNING: The JENKINS_HTTP_PORT variable is not set. Defaulting to a blank string.
WARNING: The JENKINS_HTTPS_PORT variable is not set. Defaulting to a blank string.
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.jenkins.ports contains an invalid type, it should be a number, or an object
services.jenkins.ports contains an invalid type, it should be a number, or an object
services.geonode.ports contains an invalid type, it should be a number, or an object
services.geonode.ports contains an invalid type, it should be a number, or an object
services.jenkins.ports value [':', ':', '50000:50000'] has non-unique elements
My docker compose version is v2.5.0 on Ubuntu 22.04.
I tried running $ docker compose up -d. My docker compose version is v2.5.0 on Ubuntu 22.04. If I run the command: $ docker compose up -d I get the following Warnings:
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "HTTPS_HOST" variable is not set. Defaulting to a blank string.
WARN[0000] The "HTTP_HOST" variable is not set. Defaulting to a blank string.
WARN[0000] The "HTTPS_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "LETSENCRYPT_MODE" variable is not set. Defaulting to a blank string.
WARN[0000] The "HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "HTTPS_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "HTTPS_HOST" variable is not set. Defaulting to a blank string.
WARN[0000] The "HTTP_HOST" variable is not set. Defaulting to a blank string.
WARN[0000] The "ADMIN_EMAIL" variable is not set. Defaulting to a blank string.
WARN[0000] The "LETSENCRYPT_MODE" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "POSTGRESQL_MAX_CONNECTIONS" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "JENKINS_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "JENKINS_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "JENKINS_HTTPS_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "JENKINS_HTTPS_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "JENKINS_HTTP_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "JENKINS_HTTPS_PORT" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
services.jenkins.ports array items[0,1] must be unique
My Dockerfile is
FROM python:3.10.2-buster
LABEL GeoNode development team
RUN mkdir -p /usr/src/communalp
# Enable postgresql-client-13
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN echo "deb http://deb.debian.org/debian/ stable main contrib non-free" | tee /etc/apt/sources.list.d/debian.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
# To get GDAL 3.2.1 to fix this issue https://github.com/OSGeo/gdal/issues/1692
# TODO: The following line should be removed if base image upgraded to Bullseye
RUN echo "deb http://deb.debian.org/debian/ bullseye main contrib non-free" | tee /etc/apt/sources.list.d/debian.list
# This section is borrowed from the official Django image but adds GDAL and others
RUN apt-get update -y && apt-get upgrade -y
# Prepraing dependencies
RUN apt-get install -y \
libgdal-dev libpq-dev libxml2-dev \
libxml2 libxslt1-dev zlib1g-dev libjpeg-dev \
libmemcached-dev libldap2-dev libsasl2-dev libffi-dev
RUN apt-get install -y --no-install-recommends \
gcc zip gettext geoip-bin cron \
postgresql-client-13 \
sqlite3 spatialite-bin libsqlite3-mod-spatialite \
python3-dev python3-gdal python3-psycopg2 python3-ldap \
python3-pip python3-pil python3-lxml python3-pylibmc \
uwsgi uwsgi-plugin-python3 \
firefox-esr
RUN apt-get install -y devscripts build-essential debhelper pkg-kde-tools sharutils
# RUN git clone https://salsa.debian.org/debian-gis-team/proj.git /tmp/proj
# RUN cd /tmp/proj && debuild -i -us -uc -b && dpkg -i ../*.deb
# Install pip packages
RUN pip install pip --upgrade \
&& pip install pygdal==$(gdal-config --version).* \
flower==0.9.4
# Activate "memcached"
RUN apt install -y memcached
RUN pip install pylibmc \
&& pip install sherlock
# add bower and grunt command
COPY src /usr/src/communalp/
WORKDIR /usr/src/communalp
COPY src/monitoring-cron /etc/cron.d/monitoring-cron
RUN chmod 0644 /etc/cron.d/monitoring-cron
RUN crontab /etc/cron.d/monitoring-cron
RUN touch /var/log/cron.log
RUN service cron start
COPY src/wait-for-databases.sh /usr/bin/wait-for-databases
RUN chmod +x /usr/bin/wait-for-databases
RUN chmod +x /usr/src/communalp/tasks.py \
&& chmod +x /usr/src/communalp/entrypoint.sh
COPY src/celery.sh /usr/bin/celery-commands
RUN chmod +x /usr/bin/celery-commands
COPY src/celery-cmd /usr/bin/celery-cmd
RUN chmod +x /usr/bin/celery-cmd
# # Install "geonode-contribs" apps
# RUN cd /usr/src; git clone https://github.com/GeoNode/geonode-contribs.git -b master
# # Install logstash and centralized dashboard dependencies
# RUN cd /usr/src/geonode-contribs/geonode-logstash; pip install --upgrade -e . \
# cd /usr/src/geonode-contribs/ldap; pip install --upgrade -e .
RUN pip install --upgrade --no-cache-dir --src /usr/src -r requirements.txt
RUN pip install --upgrade -e .
# Cleanup apt update lists
RUN rm -rf /var/lib/apt/lists/*
# Export ports
EXPOSE 8000
# We provide no command or entrypoint as this image can be used to enter code here`serve the django project or run celery tasks
# ENTRYPOINT /usr/src/communalp/entrypoint.sh
I'd be glad for any help. Thanks
Cheers Phil

Related

fribidi autogen.sh script failing: "autoreconf: error: automake failed with exit status: 1"

I am trying to install fribidi, but I am getting the following error when running the autogen.sh script:
-n checking for pkg-config...
/usr/local/bin/pkg-config
-n checking for libtoolize...
/usr/local/bin/glibtoolize
-n checking for autoreconf...
/usr/local/bin/autoreconf
running autoreconf --force --install --verbose
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: glibtoolize --copy --force
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force -I m4
autoreconf: running: /usr/local/Cellar/autoconf/2.71/bin/autoconf --force
configure.ac:98: warning: The preprocessor macro `STDC_HEADERS' is obsolete.
configure.ac:98: Except in unusual embedded environments, you can safely include all
configure.ac:98: ISO C90 headers unconditionally.
configure.ac:129: warning: your code may safely assume C89 semantics that RETSIGTYPE is void.
configure.ac:129: Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.
autoreconf: running: /usr/local/Cellar/autoconf/2.71/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:40: installing './compile'
configure.ac:37: installing './missing'
configure.ac:31: error: version 'fribidi_version()' doesn't follow Gnits standards
bin/Makefile.am: installing './depcomp'
lib/Headers.mk:25: warning: shell cat $(top_srcdir: non-POSIX variable name
lib/Headers.mk:25: (probably a GNU make extension)
doc/Makefile.am:16: 'lib/Headers.mk' included from here
doc/Makefile.am:21: warning: shell sed '$$d' $(top_srcdir: non-POSIX variable name
doc/Makefile.am:21: (probably a GNU make extension)
gen.tab/Makefile.am:28: warning: 'CFLAGS' is a user variable, you should not override it;
gen.tab/Makefile.am:28: use 'AM_CFLAGS' instead
gen.tab/Makefile.am:29: warning: 'LDFLAGS' is a user variable, you should not override it;
gen.tab/Makefile.am:29: use 'AM_LDFLAGS' instead
lib/Headers.mk:25: warning: shell cat $(top_srcdir: non-POSIX variable name
lib/Headers.mk:25: (probably a GNU make extension)
lib/Makefile.am:15: 'lib/Headers.mk' included from here
autoreconf: error: automake failed with exit status: 1
I already installed libtool and autoconf. How can I fix this problem?

I am getting "docker: invalid reference format." in my local machine

I am trying to run postgresql container in my local (Windows 10 machine). i am using this command :
docker run -d --name pg-docker --restart=always --publish 5432:5432 -e POSTGRES_PASSWORD=postgres -v C:\Program Files\Docker\Volumes\pg:/var/lib/postgresql/data postgres:alpine
but its returning "docker: invalid reference format." error.
(P.S. I have my postgresql image)
-v C:\Program Files\Docker\Volumes\pg:/var/lib/postgresql/data is read as two separate arguments due to the space in "Program Files". So "Files\Docker\Volumes\pg:/var/lib/postgresql/data" is interpreted as the docker image name.
Escape the space with a \ or wrap the path in quotes.

How to conditionally add flag in Fishshell

I want to set a flag when $DEBUG[1] is set:
In bash this would be the way ${DEBUG:+-v}, how to do it in Fishshell?
For example:
yarn config (not set -q DEBUG[1] && echo "-s") delete proxy
If you're in a code block (function/begin-end) you can use a variable with Brace Expansion:
set -q DEBUG[1] && set -l silent "-s"
yarn config $silent delete proxy
edit: faho added that it works also without brace expansion

How to run mongodb docker instance with custom configuration file?

I have executed the command
sudo docker run -p 37017:27017 -v /data:/data/db -v /logs:/var/log/mongodb/ -v /etc/:/etc/ --name mongocustom -d bbed8d0e01c1 --config /etc/newmongod.conf.
but soon the container exited with an error.
docker logs gives following output:
sudo docker logs mongocustom
parse error: Invalid numeric literal at line 1, column 14
parse error: Invalid numeric literal at line 1, column 14
Error parsing YAML config file: yaml-cpp: error at line 16, column 12: illegal map value
try 'mongod --help' for more information
So where I went wrong.

Passing variable from container start to file

I have the following lines in a Dockerfile where I want to set a value in a config file to a default value before the application starts up at the end and provide optionally setting it using the -e option when starting the container.
I am trying to do this using Docker's ENV commando
ENV CONFIG_VALUE default_value
RUN sed -i 's/CONFIG_VALUE/'"$CONFIG_VALUE"'/g' CONFIG_FILE
CMD command_to_start_app
I have the string CONFIG_VALUE explicitly in the file CONFIG_FILE and the default value from the Dockerfile gets correctly substituted. However, when I run the container with the added -e CONFIG_VALUE=100 the substitution is not carried out, the default value set in the Dockerfile is kept.
When I do
docker exec -i -t container_name bash
and echo $CONFIG_VALUE inside the container the environment variable does contain the desired value 100.
Instructions in the Dockerfile are evaluated line-by-line when you do docker build and are not re-evaluated at run-time.
You can still do this however by using an entrypoint script, which will be evaluated at run-time after any environment variables have been set.
For example, you can define the following entrypoint.sh script:
#!/bin/bash
sed -i 's/CONFIG_VALUE/'"$CONFIG_VALUE"'/g' CONFIG_FILE
exec "$#"
The exec "$#" will execute any CMD or command that is set.
Add it to the Dockerfile e.g:
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
Note that if you have an existing entrypoint, you will need to merge it with this one - you can only have one entrypoint.
Now you should find that the environment variable is respected i.e:
docker run -e CONFIG_VALUE=100 container_name cat CONFIG_FILE
Should work as expected.
That shouldn't be possible in a Dockerfile: those instructions are static, for making an image.
If you need runtime instruction when launching a container, you should code them in a script called by the CMD directive.
In other words, the sed would take place in a script that the CMD called. When doing the docker run, that script would have access to the environment variable set just before said docker run.