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

[6.0-marshmallow branch] add gosu; refactor things #31

Open
wants to merge 1 commit into
base: 6.0-marshmallow
Choose a base branch
from

Conversation

robbyoconnor
Copy link
Contributor

@robbyoconnor robbyoconnor commented Jul 18, 2017

This will also fix issues with the ccache env vars not showing up -- at least in my testing.

@robbyoconnor
Copy link
Contributor Author

robbyoconnor commented Jul 18, 2017

aosp@2d3c9b0ff45d:/aosp$ env 
HOSTNAME=2d3c9b0ff45d
TERM=xterm
CCACHE_DIR=/tmp/ccache
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/aosp
HOME=/home/aosp
SHLVL=1
GOSU_VERSION=1.10
USE_CCACHE=1
_=/usr/bin/env
aosp@2d3c9b0ff45d:/aosp$     

@@ -3,55 +3,47 @@
#
FROM ubuntu:14.04

MAINTAINER Kyle Manna <[email protected]>
LABEL maintainer "Kyle Manna <[email protected]>"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preferred way to specify this metadata is via a LABEL

dpkg -i *.deb && \
apt-get -f install && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not needed anymore...Java 7 is used.

@robbyoconnor robbyoconnor force-pushed the add-gosu branch 3 times, most recently from 9f66bec to a7e4d70 Compare July 18, 2017 09:31
@robbyoconnor robbyoconnor changed the title add gosu; refactor entrypoint add gosu; refactor things Jul 18, 2017
@robbyoconnor robbyoconnor changed the title add gosu; refactor things [6.0-marshmallow branch] add gosu; refactor things Jul 18, 2017
@robbyoconnor robbyoconnor force-pushed the add-gosu branch 7 times, most recently from f7b4b2f to 05fad9b Compare July 18, 2017 10:20
@robbyoconnor robbyoconnor mentioned this pull request Jul 18, 2017
@robbyoconnor robbyoconnor force-pushed the add-gosu branch 4 times, most recently from c8a6110 to d1a5a03 Compare July 18, 2017 16:33
@robbyoconnor
Copy link
Contributor Author

Fixed a small issue and rebased


# Execute command as `aosp` user
export HOME=/home/aosp
exec sudo -u aosp $args
exec gosu aosp ${args:-"bash"}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to not change this to just sudo -E <cmd> instead of all the gosu install?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure...sudo in docker is a disaster

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main reason is that it just looks cleaner from the process perspective...run top and you'll see...I was having issues with the environment variable for ccache not being seen

Copy link
Contributor Author

@robbyoconnor robbyoconnor Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to see the reason:

With sudo -E:

aosp@c1b4674f2f9c:/aosp$ ps waxu 
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  1.0  0.0  47132  3152 pts/0    Ss   00:18   0:00 sudo -u aosp -E bash
aosp        18  0.0  0.0  18172  3200 pts/0    S    00:18   0:00 bash
aosp        21  0.0  0.0  15580  2040 pts/0    R+   00:18   0:00 ps waxu
aosp@c1b4674f2f9c:/aosp$ 

Now with gosu:

aosp@7e6014c412b9:/aosp$ ps waxu 
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
aosp         1  1.7  0.0  18172  3316 pts/0    Ss   00:16   0:00 bash
aosp        24  0.0  0.0  15580  2040 pts/0    R+   00:16   0:00 ps waxu
aosp@7e6014c412b9:/aosp$ 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explains it concisely but I've pretty much shown what they were demonstrating.

@robbyoconnor
Copy link
Contributor Author

you jus see the process, not a forked process

@robbyoconnor
Copy link
Contributor Author

that said, hold off on merging this...wanna see if I can fix a small issue...there's a weird issue where I'm seeing an unmet dependency error related to openjdk and wanna fix that

@robbyoconnor robbyoconnor force-pushed the add-gosu branch 5 times, most recently from 8f176e0 to 1460c4b Compare July 19, 2017 02:32
@robbyoconnor
Copy link
Contributor Author

@kylemanna -- this is ready for showtime -- I think we should use gosu -- the rationale behind why it exists is good -- as well as the fact that it just gets out of the way vs what sudo su, etc do.

Ultimately -- this up to you -- I'm just contributing back my changes :)

@robbyoconnor robbyoconnor force-pushed the add-gosu branch 16 times, most recently from 51ddf21 to 4c49921 Compare July 25, 2017 10:25
@robbyoconnor robbyoconnor force-pushed the add-gosu branch 3 times, most recently from 2179bf7 to d408a02 Compare August 4, 2017 06:25
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

Successfully merging this pull request may close these issues.

2 participants