-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist bash history for console between containers #627
Comments
@kierenevans I gave it a little try and came up with this https://github.com/inviqa/harness-base-php/tree/feature/persistent-console-history - the way it's set up, it's the same history for all users, but that might actually be helpful 😅 |
@NoDiskInDriveA That's a clever solution, though it might need a bit more attention on linux as the volume is owned by root so will need it's permissions fixing for the build user to be able to write to it: build@3c66e3277784:/app$ ls -la /home/build/.console/
total 0
drwxr-xr-x 2 root root 6 Mar 7 08:40 .
drwxr-xr-x 1 build build 178 Mar 7 08:40 ..
build@3c66e3277784:/app$ mount | grep console
/dev/nvme0n1p3 on /home/build/.console type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota) Different users (other than root) probably can't write to it either once permissions are fixed, unless it were to be a 777 file? |
@kierenevans Damn, and here I was, using MacOS and thinking I was smart...I have zero experience how Docker behaves on Linux. I just know file permissions on shares are a PITA 😬 |
@kierenevans Though, couldn't we use an existing mount? Point HISTFILE into |
Like so? Since it's about dev experience, we could tie it to the "ws console" command instead of having to deal with multiple users. |
To improve the developer experience for harness upgrades, store
/home/build/.bash_history
on a named volume, allowing history of commands to persist between console containers for a projectOur current named volumes are here - https://github.com/inviqa/harness-base-php/blob/1.2.x/src/_base/docker-compose.yml.twig#L24-L40 - and the console container can reference them here - https://github.com/inviqa/harness-base-php/blob/1.2.x/src/_base/_twig/docker-compose.yml/service/console.yml.twig#L13-L17
The text was updated successfully, but these errors were encountered: