How to add - to environment variables in git bash [closed] - docker

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 29 days ago.
Improve this question
I tried to set the following environment variables so that I could quickly start the docker container
export doup=docker-compose up -d
However, the following error occurred and it could not be set up.
bash: export: `-d': not a valid identifier
Is there a way to set - to an environment variable?

You'd need to quote it:
export doup='docker-compose up -d'
but what you probably actually want is an alias:
alias doup='docker-compose up -d'

Related

Issue with ENTRYPOINT of [some] official docker images? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 days ago.
The community reviewed whether to reopen this question 4 days ago and left it closed:
Original close reason(s) were not resolved
Improve this question
https://github.com/nginxinc/docker-nginx/pull/752
The "issue":
If you create Dockerfile FROM nginx and specify a custom CMD (not starting with nginx), then default scripts, like environment variables substitution in config files, will not be executed at container startup. I find this behavior confusing, and looks like it is not just for me: https://github.com/nginxinc/docker-nginx/issues/422 .
The mainteiner of nginx image answered with links to other official Dockerfiles:
https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh#L302
https://github.com/docker-library/cassandra/blob/master/docker-entrypoint.sh#L43
https://github.com/docker-library/mongo/blob/master/docker-entrypoint.sh#L245
https://github.com/apache/couchdb-docker/blob/main/3.3.1/docker-entrypoint.sh#L27
https://github.com/Kong/docker-kong/blob/master/docker-entrypoint.sh#L31
https://github.com/MariaDB/mariadb-docker/blob/master/docker-entrypoint.sh#L486
https://github.com/docker-library/mysql/blob/master/template/docker-entrypoint.sh#L386
So i wonder is there any reason why is entrypoint scripts of these images implemented this way? That if you override CMD(with custom script for example not named as nginx or mysql, etc..) then ENTRYPOINT is not doing anything other than exec your CMD. So it is equivalent of implicitly overriding the ENTRYPOINT without explicitly overriding it.
Isn't it will be more clear that if you specify custom CMD then you get all default ENTRYPOINT behavior, and if you don't need it then you override the ENTRYPOINT explicitly?

Installing "en_US" in RHEL container [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I'm testing an ansible role using molecule. The role install a corporate binary over which I've no insight, I'm just mean to ./binary --silent and that's it. Over RedHat.
It work for a RedHat 6.9 VM. But it doesn't work over the docker container registry.access.redhat.com/rhel6:6.9.
The error message says:
"Operating system bad language (en_US not found)".
What could be missing from the container that would be on the VM? Some localedef ...? I wasn't able to find a doc about this, but is there some RedHat description about the delta between their "minimal install from ISO" VMs and containers?
Thanks for any help
If you run locale -a on the Docker image you're using, you'll get the following output:
C
en_US.utf8
POSIX
Run the same command in your VM and compare output. If it contains line en_US (without utf-8 suffix), try adding the following lines dicrectly below FROM directive in your Dockerfile:
RUN localedef -v -c -i en_US -f UTF-8 en_US; exit 0
RUN sed -i 's/en_US.UTF-8/en_US/g' /etc/sysconfig/i18n && source /etc/sysconfig/i18n
This will generate locale en_US with encoding UTF-8 named en_US (without any suffix).

Is there a startup file (like .bashrc) for i3 where i can set environmet variables? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
It would help me to setup my system-wide proxy. I'm using latest Ubuntu and tried /etc/X11/xinit/xinitrc ~/.xinitrc and ~/.xsession,
export HTTP_PROXY=http://....
But that did not work.
Apparently i3 uses sh to launch stuff, and does not source $PATH from ~/.bashrc :
cat ~/.xsession-errors
(...)
/bin/sh: 1: mycommand: not found
So, just create a ~/.xsessionrc file and put your statements in it :
export HTTP_PROXY=http://....
Then logout and back in ; It should work now.
System-wide environment can be setup by placing a script in /etc/profile.d/
For example, you may create /etc/profile.d/proxy with your
export HTTP_PROXY=http:// # enter your proxy settings here
Then chmod +x this file, then reboot :
chmod +x /etc/profile.d/proxy
systemctl reboot
After reopening your session you could check the variables are there :
env | grep HTTP
You should see the variables set with the values you entered in the profile script.
In order to set system wide proxy settings you can add the following:
export http_proxy='http://172.27.100.5:4444/'
export https_proxy='http://172.27.100.5:4444/'
export ftp_proxy='http://172.27.100.5:4444/'
export no_proxy='localhost,127.0.0.0/8,::1
to your bash.bashrc file which is located in /etc folder. Of course, you should replace addresses with your ones. It works at least for Debian.

why the cygWin grep gives error? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am trying to recursively search for the below string in all my C# files. Why am I gettig this error? Took me a lontime to install CygWin and I have been using Unix forever, but this is not acting like Unix's grep. Noteworthy that I am using Cygwin for my WIndows7. Thanks
grep -R 'new IIntf' *.*
grep: *.*: No such file or directory
grep -R 'new IIntf' *.cs
grep: *.cs: No such file or directory
There may be no files matching *.* in the current directory. Perhaps you mean grep -R 'new IIntf' .

Where do I find the "cd" command? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I need to know to know the full path of the command "cd" in ubuntu 10.04. Can anyone please help me find it. For example the full path of the command "dir" is "File System/bin/dir".
-Thanks in advance
cd is one of the builtin commands of bash (or similar shells).
/usr/bin/which screws up on shell builtins; type is a better alternative:
$ type cd
cd is a shell builtin

Resources