Skip to content
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

HOME directory #255

Open
t12ung opened this issue Aug 8, 2019 · 3 comments · May be fixed by #454
Open

HOME directory #255

t12ung opened this issue Aug 8, 2019 · 3 comments · May be fixed by #454

Comments

@t12ung
Copy link

t12ung commented Aug 8, 2019

Hello. I am using centos/php-72-centos7 as a base template for my Dockerfile.

When I run an interactive terminal into the container, it creates .bash_history file inside APP_DATA directory which I don't want.

I have tried changing the home directory in /etc/passwd but this does not seem to make any difference. When I run echo $HOME, it is always set to what $APP_DATA is.

I know I can override the HOME variable by setting the environment variable to the docker exec command, but I'd prefer not having to do this specifically for this image container.

Is there a way to change the HOME directory for the image during the build process or when it is run by docker-compose?

@phracek
Copy link
Member

phracek commented Mar 28, 2023

@t12ung The patch is welcome. Also, at least a test is welcome.
Is this issue still valid?

@pkubatrh
Copy link
Member

I think it would be enough to move the history file from /opt/app-root/src/ to /opt/app-root

@zmiklank
Copy link
Contributor

It should be possible by exporting HISTFILE envvar

export HISTFILE=${APP_ROOT}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants