following this tutorial I'm trying to dockerize my Elixir Umbrella project before pushing to production.
I'm trying to run my app through Docker using this command:
docker run --rm -ti \
-p 4000:4000 \
-e COOKIE=a_cookie \
-e BASIC_AUTH_USERNAME=UserName \
-e BASIC_AUTH_PASSWORD=Password \
-e BASIC_AUTH_REALM=realm \ political_project:0.1.0
I get the following error: docker: invalid reference format. See 'docker run --help'.
As I am new to Docker, I have no clue what the problem might come from.
when I run docker images, I get:
REPOSITORY TAG IMAGE ID CREATED SIZE
political_project 0.1.0 0618eaa9fcf0 8 minutes ago 54.7MB
<none> <none> ce28b64790a6 8 minutes ago 370MB
bitwalker/alpine-elixir-phoenix latest cc054692aa5e 37 hours ago 311MB
alpine 3.6 43773d1dba76 12 days ago 4.03MB
Just remove the last blackslash right in front of the image name
docker run --rm -ti \
-p 4000:4000 \
-e COOKIE=a_cookie \
-e BASIC_AUTH_USERNAME=UserName \
-e BASIC_AUTH_PASSWORD=Password \
-e BASIC_AUTH_REALM=realm political_project:0.1.0
Related
i want to create a NIFI container and pass it a template/flow to be loaded automatically when the container is being created (without human intervention).
couldn't find any volumes/environments that are related to it.
i tried using (suggested by chatGPT):
docker run -d -p 8443:8443 \
-v /path/to/templates:/templates \
-e TEMPLATE_FILE_PATH=/templates/template.xml \
--name nifi apache/nifi
and
docker run -d -p 8443:8443 \
-e NIFI_INIT_FLOW_FILE=/Users/l1/Desktop/kaleidoo/devops/files/git_aliases/flow.json \
-v /Users/l1/Desktop/kaleidoo/docker/test-envs/flow.json:/flow.json:ro \
--name nifi apache/nifi
non of them worked, and i couldn't find data about NIFI_INIT_FLOW_FILE and TEMPLATE_FILE_PATH in the documentation.
I started docker with this command:
docker run -it --shm-size=4g \
-e PBF_URL=https://download.geofabrik.de/north-america/us-latest.osm.pbf \
-e REPLICATION_URL=https://download.geofabrik.de/north-america/us-updates/ \
-e IMPORT_US_POSTCODES=true \
-e IMPORT_TIGER_ADDRESSES=true \
-e IMPORT_WIKIPEDIA=/nominatim/extras/wikimedia-importance.sql.gz \
-p 8080:8080 \
-v /osm-maps/extras:/nominatim/extras \
--name nominatim \
mediagis/nominatim:4.0
It takes quite some time to load the data.. When I do docker images I see this:
REPOSITORY TAG IMAGE ID CREATED SIZE
mediagis/nominatim 4.0 3097bc96440b 3 weeks ago 875MB
For some reason I woke up this morning and the box I had this running on was off.. I really hope I don't have to reload all the data again.. Is there a way to start this back up without reloading data?
I am setting up quay in a vm with centos distro. This is the guide I am following: quay deploy guide
once I install Podman I am trying to run first container with below command:
I set up this env variable:
export QUAY=QUAY
and made a dir of same name in home:
mkdir QUAY
once I install Podman I am trying to run first container with below command:
$ sudo podman run -d --rm --name postgresql-quay \
-e POSTGRESQL_USER=quayuser \
-e POSTGRESQL_PASSWORD=quaypass \
-e POSTGRESQL_DATABASE=quay \
-e POSTGRESQL_ADMIN_PASSWORD=adminpass \
-p 5432:5432 \
-v $QUAY/postgres-quay:/var/lib/pgsql/data:Z \
registry.redhat.io/rhel8/postgresql-10:1
and I am getting following error:
sudo podman run -d --rm --name postgresql-quay -e POSTGRESQL_USER=quayuser -e POSTGRESQL_PASSWORD=quaypass -e POSTGRESQL_DATABASE=quay -e POSTGRESQL_ADMIN_PASSWORD=adminpass -p 5432:5432 -v QUAY/postgres-quay:/var/lib/pgsql/data:Z registry.redhat.io/rhel8/postgresql-10:1
Error: error creating named volume "QUAY/postgres-quay": error running volume create option: names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*: invalid argument
The bind mount needs to be specified as an absolute path or a relative path that starts with ./ or ../.
In other words instead of
-v QUAY/postgres-quay:/var/lib/pgsql/data:Z
use
-v ./QUAY/postgres-quay:/var/lib/pgsql/data:Z
(I replaced $QUAY with its value QUAY)
I noticed that gitlab image container when starting adds additional info to the status field of the docker ps command:
Up 19 seconds (health: starting)
once its got ready the status changed to:
Up 3 minutes (healthy)
Usually there is no information in brackets present but gitlab somehow manages to print that additional text to the status field.
How to print an arbitrary text to the status field when running container? Should this be done inside the Dockerfile or the running container should have a process that outputs the text that appears in status field of docker ps?
to run gitlab you may use this script:
#!/bin/sh
set -e;
set -f;
export GITLAB_HOME="/tmp/gitlab/srv/gitlab";
mkdir -p "$GITLAB_HOME";
mkdir -p "$GITLAB_HOME/var/opt/gitlab";
mkdir -p "$GITLAB_HOME/var/log/gitlab";
mkdir -p "$GITLAB_HOME/etc/gitlab";
docker run --detach \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
after running it run
docker ps
to see the additional text in the status field, after approx 1min it should change to (healthy)
I am running Oracle Database in a docker container with the following command:
sudo docker run -d -it –rm –name oracle19se -v /home/oracle/oradata19c:/opt/oracle/oradata -p 1521:1521 -p 5500:5500 oracle/database:19.2.0-ee
and getting the following error message similar to the one described here:
docker: invalid reference format.
What can be wrong with the command syntax? I have an impression that previously (probably before my Ubuntu 18.04 update) this command worked fine.
the image I am trying to run:
REPOSITORY TAG IMAGE ID CREATED SIZE
oracle/database 19.2.0-ee afc10cf87f83 2 months ago 6.34GB
Other 'run' commands like these, for example:
sudo docker run -d -it --rm --name oracle18se -v /home/oracle/oradata18:/opt/oracle/oradata -p 1521:1521 -p 5500:5500 oracle/database-se:18.3.0
sudo docker run -d -it –rm –name oracle12se -v /home/oracle/oradata12:/opt/oracle/oradata -p 1521:1521 -p 5500:5500 oracle/database-se:12.2.0.1
works fine. What is the difference? The list of all my images:
REPOSITORY TAG IMAGE ID CREATED SIZE
oracle/database 19.2.0-ee afc10cf87f83 2 months ago 6.34GB
oracle/database-se 12.2.0.1 83dd2e26f291 4 months ago 6.1GB
oracle/database-se 18.3.0 c26bfe962137 4 months ago 8.53GB
oracle/database 18.3.0 493b0fcf7c08 4 months ago 8.49GB
oraclelinux 7-slim c3d869388183 6 months ago 117MB
Your double dashes on rm and name got converted into a different hyphen character, likely by whatever editor you are using. Those are not valid and docker tries to parse –rm as an image name. This is not a valid syntax/format for an image name, and it cannot resolve the reference to an image to pull. Instead run the following:
sudo docker run -d -it --rm --name oracle19se -v /home/oracle/oradata19c:/opt/oracle/oradata -p 1521:1521 -p 5500:5500 oracle/database:19.2.0-ee