Starting Cassandra with docker gives error - cassandra

While starting cassandra with the below command, gives the error as
docker: invalid reference format: repository name must be lowercase. See 'docker run --help'.
docker run -e DS_LICENSE=accept --memory 4g -e CASSANDRA_ENDPOINT_SNITCH="GossipingPropertyFileSnitch" CASSANDRA_DC="testDC" CASSANDRA_RACK="testRack" DS_LICENSE=accept --memory 4g --name cassandra -d datastax/dse-server -g -s -k -v /Users/test/cassandranode01:/var/lib/cassandra
Below is my repository screenshot
Please assist me on this.

could you try using a specific version tag of DSE like 6.7.8? Latest tag is not working anymore.
Like this
docker run -e DS_LICENSE=accept --memory 4g -e CASSANDRA_ENDPOINT_SNITCH="GossipingPropertyFileSnitch" CASSANDRA_DC="testDC" CASSANDRA_RACK="testRack" DS_LICENSE=accept --memory 4g --name cassandra -d datastax/dse-server:6.7.8 -g -s -k -v /Users/test/cassandranode01:/var/lib/cassandra

Related

Running "docker exec" displays "bash-4.2" in "Shell command prompt"

docker run -itd --restart always --network host --name test_db -h test_db -v share:/home/share -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime -v /sys/fs/cgroup:/sys/fs/cgroup:ro --privileged mariadb_10.8 init
Running docker exec -it test_db bash displays root#test_db in the shell command prompt, but after someday bash-4.2 appeared.
And there is no ll command and no /root folder
How to fix it?
Thanks in advance.
Regards

How to set machine hostname as docker container hostname

I want to set the docker container hostname to the machine hostname on which docker is installed. Please note than I want to set the hostname dynamically and don't want to hardcode the machine hostname in my docker run command.
How do I achieve this?
My docker run command:
sudo docker run --name=rabbitmq -d -p 5672:5672 -p 15672:15672 \
-e RABBITMQ_DEFAULT_USER=admin \
-e RABBITMQ_DEFAULT_PASS=admin \
--hostname ?? \
-v rmq_vol:/var/lib/rabbitmq \
rabbitmq:3.9.0
What KamilCuk said.
add to docker run: --hostname $(hostname)
You're just passing in the result of the linux "hostname" command to your docker run configuration.

Docker gitlab-ci runner immediately exits

I'm trying to register a gitlab-runner that is running within Docker as per https://docs.gitlab.com/runner/install/docker.html
docker run \
-p 8093:8093 \
-v /var/run/docker.sock:/var/run/docker.sock \
--mount type=bind,source=/etc/ssl/certs/ca-certificates.crt,target=/etc/ssl/certs/ca-certificates.crt \
gitlab/gitlab-runner:latest register \
--non-interactive \
--executor shell \
--url "$REGISTRATION_URL" \
--registration-token "$REGISTRATION_TOKEN" \
--limit "1" \
--name "cumulus-runner" \
--tls-ca-file="/etc/ssl/certs/ca-certificates.crt" \
--tag-list "cumulus"
When the container starts, the process exits immediately afterwards:
❯ docker run -p 8093:8093 -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=/etc/ssl/certs/ca-certificates.crt,target=/etc/ssl/certs/ca-certificates.crt gitlab/gitlab-runner:latest register -n --executor shell -u "$REGISTRATION_URL" -r "$REGISTRATION_TOKEN" --limit "1" --name "cumulus-runner" --tls-ca-file="/etc/ssl/certs/ca-certificates.crt" --tag-list "cumulus" Runtime platform arch=amd64 os=linux pid=6 revision=7a6612da version=13.12.0
Running in system-mode.
Registering runner... succeeded runner=jMkWoLVS
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
❯ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
62febd5e7573 gitlab-runner:latest "/usr/bin/dumb-init …" 4 minutes ago Exited (0) 4 minutes ago practical_shamir
When I run the command outside of docker, the gitlab-runner process is kept alive:
❯ ps aux | grep gitlab-
root 1717 0.0 0.1 1904556 21200 ? Ssl Jun08 0:35 /usr/bin/gitlab-runner run --working-directory /var/lib/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner
Am I overlooking something? I feel like the container should be kept alive?
In my test, I did not use -p
docker volume create gitlab-runner-config
docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v gitlab-runner-config:/etc/gitlab-runner \
gitlab/gitlab-runner:latest
or you can check the logs, what's the error?
docker logs gitlab-runner

How to use Amazon EBS for persistent storage in ArangoDB?

We are working on setting up an ArangoDB cluster in DC/OS. For the data storage we've mounted 100 GB of
EBS to /dcos/volume1 as mentioned and the disk space is getting reflected in the DC/OS dashboard.
However the ArangoDB Db server process gets launched with the below docker command :
I0110 13:04:25.273998 21115 docker.cpp:815] Running docker -H unix:///var/run/docker.sock run --cpu-shares 1024 --memory 16106127360 -e CLUSTER_ROLE=primary -e CLUSTER_ID=DBServer005 -e ADDITIONAL_ARGS= -e AGENCY_ENDPOINTS=tcp://172.22.0.75:1025 tcp://172.22.0.198:1025 tcp://172.22.0.171:1025 -e HOST=172.22.0.128 -e PORT0=1025 -e LIBPROCESS_IP=172.22.0.128 -e MESOS_SANDBOX=/mnt/mesos/sandbox -e MESOS_CONTAINER_NAME=mesos-085398be-0bc9-4b23-9a13-4a7379530ea9-S3.1db76e46-20c1-48ba-ad2f-978874118930 -v /var/lib/mesos/slave/slaves/085398be-0bc9-4b23-9a13-4a7379530ea9-S3/frameworks/085398be-0bc9-4b23-9a13-4a7379530ea9-0045/executors/6f9b1b94-5dee-4454-bbe8-48f82e65d4d3/runs/1db76e46-20c1-48ba-ad2f-978874118930/myPersistentVolume:/var/lib/arangodb3:rw -v /var/lib/mesos/slave/slaves/085398be-0bc9-4b23-9a13-4a7379530ea9-S3/frameworks/085398be-0bc9-4b23-9a13-4a7379530ea9-0045/executors/6f9b1b94-5dee-4454-bbe8-48f82e65d4d3/runs/1db76e46-20c1-48ba-ad2f-978874118930:/mnt/mesos/sandbox --net bridge -p 1025:8529/tcp --name mesos-085398be-0bc9-4b23-9a13-4a7379530ea9-S3.1db76e46-20c1-48ba-ad2f-978874118930 arangodb/arangodb-mesos:3.1
Does this mean that the persistent data is stored within this location: /var/lib/? If so, is there any option to make the data get stored in different volume such as /dcos/volume1?
In the ArangoDB DCOS install config, I couldn't find any options to attach persistent volumes.

Should using a temporary docker container remove a volume?

Running a docker container with the --rm option deletes a mounted volume post exit. I'm wondering whether this is intended behavior?
Here is the exact sequence.
ole#MKI:~$ docker volume create --name a-volume-test
ole#MKI:~$ sudo ls /var/lib/docker/volumes/ | grep a-
a-volume-test
ole#MKI:~$ docker run --rm -it -v a-volume-test:/data alpine /bin/ash
/ # touch /data/test
/ # ls /data
test
/ # exit
ole#MKI:~$ sudo ls /var/lib/docker/volumes/ | grep a-
After I exit the the volume is gone.
This was a bug that will be fixed in docker 1.11 - https://github.com/docker/docker/pull/19568
According to the Docs, no that is not intended, because you are mounting a named volume it should not be deleted. Maybe submit a github issue?
Note: When you set the --rm flag, Docker also removes the volumes associated with the container when the container is removed. This is similar to running docker rm -v my-container. Only volumes that are specified without a name are removed. For example, with docker run --rm -v /foo -v awesome:/bar busybox top, the volume for /foo will be removed, but the volume for /bar will not. Volumes inheritted via --volumes-from will be removed with the same logic -- if the original volume was specified with a name it will not be removed.
Source: Docker Docs

Resources