All Questions
93 questions
5
votes
4
answers
520
views
Getting multiple variables from the output of docker exec command in a bash script?
I would like to execute a script on a host machine (script_on_host.sh), which then reaches inside a docker container in order to grab some data using a second script (script_in_container.sh). The data ...
0
votes
1
answer
44
views
How to start a screen session from entrypoint shell script, and make it persist?
I am starting a screen session in my entrypoint shell script in docker, then log the output of screen -list to a file.
#!/bin/bash
screen -S my_screen -dm bash -c 'cd project && npm run start'...
0
votes
0
answers
1k
views
Dockerfile - /usr/bin/bash: exec: No such file or directory
I'm just starting out with building containers and have run into this odd issue. The above error comes up when I try to setup apache2 in a container. My ENTRYPOINT and CMD are as follows
ENTRYPOINT [&...
0
votes
0
answers
165
views
how to send signal to (parent process?) telling the parent that the child is crashing
This is probably not a best practice, but I am trying it out.
I have this entrypoint.sh file that I use with docker like so:
ENTRYPOINT ["./entrypoint.sh"]
here was entrypoint.sh:
#!/usr/...
-1
votes
2
answers
130
views
How I could check connectivity in shell using an oneliner command without using netcat?
In a docker image I want to avoid installing netcat in order to ping for db connectivity at my entrypoint script:
/bin/sh
MOODLE_DB_HOST="xxxx"
MOODLE_DB_PORT=80
function pingdb {
OK=0
...
1
vote
0
answers
265
views
Is it possible to copy a low-level utility like bash from one docker image to another?
I feel like I am missing something fundamental to lower-level utilities like bash or echo.
I have a docker image (ImageA) that is missing a shell utility so it is nearly un-interactable and I need ...
0
votes
0
answers
451
views
Run a docker container in a new interactive terminal with sshpass!
I'm trying to run a Docker container in a new interactive terminal with sshpass. I've found that:
gnome-terminal --tab -- sh -c \
"sshpass -p "password" ssh name@ip -t 'bash -ic docker ...
-2
votes
2
answers
609
views
How to use positional parameter in docker exec command with here strings (<<<)?
Here is what I am trying to do:
docker exec -it $1 /bin/bash <<< $CONTAINER_ID
But this doesn't work:
Output: "docker exec" requires at least 2 arguments.
It seems that <<...
0
votes
2
answers
113
views
Writing a regular expression to list IPv4 addresses found in a docker network
Hello while inspecting the characteristics of a docker network with the command docker network inspect network59 , I noticed the precence of ipv4 address and I would like to write a regular expression ...
0
votes
0
answers
1k
views
Inside Docker: mkdir(-p): No such file or directory
I have encountered a strange problem where the mkdir -p command fails to create a directory and returns the following error message:
[root@202 ~]# pwd
/root
[root@202 ~]# mkdir -p a/b/c
mkdir: cannot ...
1
vote
0
answers
1k
views
Docker does not trigger login or invoke /etc/profiles?
Trying to deal with the problem of
dircolors: no SHELL environment variable, and no shell type option given
when I start my docker container.
So from
What sets the $SHELL environment variable? it can ...
0
votes
1
answer
400
views
terminal output is broken in docker compose output
Im facing an issue with how the log in docker compose looks like, seems somehow broken as shown below
==> Emulator is ready : '1' is not completely override the previous output "please wait&...
-1
votes
1
answer
3k
views
How to pass shell parameters when running a docker image?
I've implemented a bash script which accepts the following parameters
SYNOPSIS
run.sh: run.sh [-H|-L|-P profile -D device [-R runtime]]
list the fio profiles natively supported by the docker ...
0
votes
0
answers
249
views
Any variable assignment would be empty inside docker
I have a long script that would be copied inside the docker image in Dockerfile and would be executed there.
I'm using bash. Both in my local machine, and inside my docker.
I run this code to ensure ...
0
votes
1
answer
83
views
Errors appending text with `sed`
I have a podman-compose file:
version: "3.8"
services:
kiwix-serve:
image: docker.io/kiwix/kiwix-serve:3.3.0-1
volumes:
- kiwix_data:/data
- /home/meijin3/zim/...