Dec 9, 2019 15:10
you're welcome and happy to help. yes, it was hard to think the the issue would turn out to be so trivial. :D
Dec 9, 2019 15:08
Exactly.
Dec 9, 2019 15:08
Actually, I remember I told you to skip -t when using docker build because we were just testing anyway. If you use docker build -t <image_name> . and then docker-compose up -d, things will work.
Dec 9, 2019 15:07
Yes.
Dec 9, 2019 15:07
when you run docker-compose --build it'll build the image with the same name, i.e., the same image is modified.
Dec 9, 2019 15:06
but since you're not referencing this new random image in your docker-compose.yml file, it didn't work.
Dec 9, 2019 15:06
It didn't work for you when you run docker build . and then docker-compose up -d because when you don't use -t with docker build (as in docker build -t) the image created will be a random hex.
Dec 9, 2019 15:05
No problem. Allow me to explain why this happened.
Dec 9, 2019 14:57
everyone's story :D
Dec 9, 2019 14:55
Dec 9, 2019 14:53
hold on
Dec 9, 2019 14:53
I have a relevant meme if you're interested :|
Dec 9, 2019 14:52
I'll add the rebuild part in my answer.
Dec 9, 2019 14:52
You're welcome. :)
Dec 9, 2019 14:51
Cool. Turned out trivial :p
Dec 9, 2019 14:47
Once rebuild, the new changes (alias because of .sh) files were in effect?
Dec 9, 2019 14:47
So basically, the whole issue was that you build the image and then probably added the .sh file later on in the Dockerfile but did not rebuild the images with changes.
Dec 9, 2019 14:46
-d and --build serve different purposes. -d is to run it in detached mode (detached to tty) and --build is to rebuild the container before starting it up.
Dec 9, 2019 14:45
I believe you can run docker-compose up -d --build and even that'll work.
Dec 9, 2019 14:06
Allow me some time. I am in transit. Will look in after 40 mins.
Dec 9, 2019 13:58
yes
Dec 9, 2019 13:51
Also, can you post the terminal activity while you do it?
Dec 9, 2019 13:51
Did you try stopping and killing all the containers and then doing it again?
Dec 9, 2019 12:14
Because if all the container are stopped and I try `docker exec` without `docker run`, I get this:

docker exec -it laravel cat /root/.bashrc
Error response from daemon: Container d15a8ba50c8822a12c1782266446a95a1a17857e2a51fba7ead51fcab76ebd65 is not running
Dec 9, 2019 12:13
Can you stop all the containers and kill them and then try if you're able to directly docker exec without docker run or docker-compose up?
Dec 9, 2019 12:12
interesting
Dec 9, 2019 12:10
docker exec cannot run with a preceding docker run
Dec 9, 2019 12:09
I mean when you run cat directly and when you exec and cat
Dec 9, 2019 12:08
can you paste the terminal activity ?
Dec 9, 2019 12:06
@GluePear cool
Dec 9, 2019 12:06
Hey, it doesn't matter for me if I run bash and then exec into the container or directly run cat command. I can see the alias at all times.
Dec 9, 2019 12:04
so that I can do some things from my end
Dec 9, 2019 12:04
can you paste the current Dockerfile here.
Dec 9, 2019 12:03
hold on, lemme think
Dec 9, 2019 12:03
seems unreal to me :D
Dec 9, 2019 12:02
woah!
Dec 9, 2019 12:02
sorry, do not use the -t flag in docker build.
Dec 9, 2019 12:01
and then execute the .sh file once you are connected to the container shell
Dec 9, 2019 12:00
So, the process is to do this:

docker build -t --no-cache=true .
docker run -it <image> bash
Dec 9, 2019 12:00
can you exec in the container and then execute the /docker-bootstrap.sh file manually?
Dec 9, 2019 11:58
can you build the container again? Did you provide executable permissions to the .sh file ?
Dec 9, 2019 11:57
you are root when you exec in the container, right?
Dec 9, 2019 11:56
Even I am intrigued now. What can be causing this issue?
Dec 9, 2019 11:55
that's really strange.
Dec 9, 2019 11:55
Hmm.
Dec 9, 2019 11:55
@GluePear Hold on, you mean docker exec ... or docker-exec ... ?
Dec 9, 2019 11:55
@GluePear yes. I still see the new alias. Also, -d only detaches the container from the tty and should have no effect in this situation.
Dec 9, 2019 11:55
It shouldn't create a difference. docker-compose.yml should work in the same way as docker run .... Please provide the docker-compose.yml file too in the question anyway to make it easier to debug.
 

Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Aug 19, 2019 17:36
Thanks guys :)
Aug 19, 2019 17:35
@Kevin @ParitoshSingh :D