Closed jamedina09 closed 1 month ago
This looks like a great workaround for the time being. Thanks @jamedina09. I'm going to build it into the image and have the attendees repull the fates container on Monday. I've made a commit to the tutorial-containers repo to add this: https://github.com/NGEET/tutorial-containers/commit/724809582d0e97e0e4a7fd9afa2b62ea8df4223c. I'll give you a heads up once I rebuild and push it to dockerhub
New build is up on dockerhub and should be working. I'm testing it with the bci run script now.
Build looks good. The new cd
function appears to work as expected!
I just tested it too. It works smoothly. Thanks.
Minor minor bug:
I've just came across the 'cd' behaviour inside docker (Greg mentioned this before). This is minor as users can type type 'cd /' to go to the root directory. But it would be nice (I think) to have the default behaviour of 'cd' to go to the root directory.
Showing the issue with the 'cd' command in the Docker container
Start the Docker Compose services in detached mode
Access the running Docker container with an interactive bash shell
Navigate to a directory within the container
The command prompt displays: modeluser@docker:/tools$
Change to the home directory (default behavior of 'cd' with no arguments)
The command prompt moves to the home directory: modeluser@docker:~$
Possible solution to make the 'cd' command return to the root directory when no arguments are given
Open a new terminal and access the Docker container again
Edit the user's .bashrc file with vim
Enter Insert Mode in vim
Add a custom cd function to .bashrc
Exit Insert Mode
Save and exit vim
Apply the changes made to .bashrc
Navigate to a directory within the container again
Change to the home directory (this should now take you to the root directory)
Success:
The command prompt now displays: modeluser@docker:/$
That 'cd' function could be included by default