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 environment var ignore on version 0.9.11 and 0.9.12 #119

Closed
bySabi opened this issue Jul 28, 2014 · 7 comments
Closed

HOME environment var ignore on version 0.9.11 and 0.9.12 #119

bySabi opened this issue Jul 28, 2014 · 7 comments
Milestone

Comments

@bySabi
Copy link

bySabi commented Jul 28, 2014

Using a minimal Docker file:

# mosquitto
# VERSION 0.0.2

FROM phusion/baseimage:0.9.12
MAINTAINER bySabi <flxinformatico@gmail.com>

# Set correct environment variables.
ENV DEBIAN_FRONTEND noninteractive
ENV HOME /root
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
RUN \
        echo "Europe/Madrid" > /etc/timezone && \
        dpkg-reconfigure -f noninteractive tzdata

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

and then connect docker image via ssh. I got this result changing phusion/baseimage VERSION:

OK

Version: 0.9.10
root@d0891ea1ac6f:~# cat /etc/container_environment.json; echo
{"HOME": "/root", "HOSTNAME": "d0891ea1ac6f", "LANG": "en_US.UTF-8", "INITRD": "no", "TERM": "xterm", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin

WRONG ( HOME var ignored)

Version: 0.9.11
root@fab14d95caca:~# cat /etc/container_environment.json; echo
{"INITRD": "no", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG": "en_US.UTF-8", "LC_ALL": "en_US.UTF-8", "TERM": "xterm", "DEBIAN_FRONTEND": "noninteractive", "HOSTNAME": "fab14d95caca"}
root@fab14d95caca:~# 

Version: 0.9.12
root@96b682aed472:~# cat /etc/container_environment.json; echo
{"LANG": "en_US.UTF-8", "HOSTNAME": "96b682aed472", "DEBIAN_FRONTEND": "noninteractive", "LC_ALL": "en_US.UTF-8", "INITRD": "no", "TERM": "xterm", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
root@96b682aed472:~# 
@bySabi
Copy link
Author

bySabi commented Jul 28, 2014

I have three HOME vars:

1- HOME is "" expanding from Ex: rc.local
2- HOME is "/root" from ssh
3- HOME is "/home/felix" using sudo docker-bash contID

Then my automated script running without shell fail with: not HOME defined.

@bartt
Copy link

bartt commented Aug 18, 2014

The same applies to SHELL.

@grempe
Copy link

grempe commented Sep 4, 2014

I also experienced this issue. This workaround seems to work for me so far in my Dockerfile to set HOME=/root

# Set correct environment variables.
#ENV HOME /root      # FAILS TO WORK in 0.9.13
RUN echo /root > /etc/container_environment/HOME

@lxms
Copy link

lxms commented Apr 21, 2015

Faced the same today in Docker 1.5.0 with baseimage 0.9.16
Proposed workaround helps, thanks to @grempe

@FooBarWidget
Copy link
Member

We ignore HOME, SHELL, USER and a bunch of other environment variables on purpose, because not ignoring them will break multi-user containers. See #86

But I recognize that this causes confusion, so we should update the documentation accordingly.

@jbryanscott
Copy link

Also faced the same today in Docker 1.11.2 with baseimage 0.9.18
Proposed workaround fixes, thanks to @grempe

@Theaxiom
Copy link
Collaborator

I added this to the README.md:

@Theaxiom Theaxiom added this to the 0.9.20 milestone Mar 21, 2017
cardoe added a commit to cardoe/docker-yocto that referenced this issue Sep 11, 2017
HOME was ignored by the phusion container. Workaround in
phusion/baseimage-docker#119
cardoe added a commit to cardoe/docker-yocto that referenced this issue Sep 11, 2017
HOME was ignored by the phusion container. Workaround in
phusion/baseimage-docker#119
tsujigiri added a commit to ComboStrikeHQ/docker-rails that referenced this issue Jul 4, 2019
The `HOME` environment variable is being ignored in phusion/baseimage.
This implements the workaround proposed in
phusion/baseimage-docker#119 (comment).
tsujigiri pushed a commit to ComboStrikeHQ/docker-rails that referenced this issue Jul 4, 2019
The `HOME` environment variable is being ignored in phusion/baseimage.
This implements the workaround proposed in
phusion/baseimage-docker#119 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants