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

Why the HOME of root change sometimes? #490

Closed
DinoStray opened this issue May 1, 2018 · 3 comments
Closed

Why the HOME of root change sometimes? #490

DinoStray opened this issue May 1, 2018 · 3 comments

Comments

@DinoStray
Copy link

Sometimes the HOME of root is /root
And Somtimes it is /
Why the HOME enviroment change sometimes?

@PikachuEXE
Copy link
Contributor

How to reproduce?

@DinoStray
Copy link
Author

DinoStray commented Jun 28, 2018

File: Dockerfile

FROM phusion/baseimage:0.10.1
LABEL maintainer="yulin.li@blockin.com"

# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]

ENV HOME /root
ENV TERM xterm

RUN echo $HOME

RUN mkdir -p /etc/service/xcoind
ADD run.sh /etc/service/xcoind/run
RUN chmod +x /etc/service/xcoind/run

File: run.sh

#!/usr/bin/env bash

echo $HOME

In Dockerfile
RUN echo $HOME
echo /root

but in run.sh
echo $HOME
echo nothing

some cmds:
docker build -t test --no-cache .
docker run --name tt -d test
docker logs --tail 50 --follow --timestamps tt

and if login docker
docker exec -it tt bash
then run
echo $HOME
show:
/root

@PikachuEXE

@PikachuEXE
Copy link
Contributor

See #119 (comment)

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

No branches or pull requests

2 participants