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

Detect existing var lib docker on hd #40

Merged
merged 3 commits into from Feb 4, 2014

Conversation

Projects
None yet
5 participants
@SvenDowideit
Copy link
Contributor

SvenDowideit commented Dec 14, 2013

#23 - it works, and it changes the on HD format to use /var/lib/docker and /var/lib/boot2docker for both empty disks and ones with OS's on them.

for now, I've added /var/lib/boot2docker/etc/hostname and /var/lib/boot2docker/etc/docker-daemon on the HD to allow us to customised the hostname (I have 2 or 3 of these atm) and the daemon commandline

it looks for /vm and if it finds it uses the old layout, plus the customisable files.

@tianon

This comment has been minimized.

Copy link
Contributor

tianon commented Dec 14, 2013

Kudos for stopping the creation of outside things in /var/lib/docker! It's probably worth including a link to your unconfined symlink ticket upstream, in case the review there takes a bit. :)

@SvenDowideit

This comment has been minimized.

Copy link
Contributor Author

SvenDowideit commented Dec 14, 2013

see moby/moby#3217 for a resolution on the docker-side

@steeve

This comment has been minimized.

Copy link
Contributor

steeve commented Dec 17, 2013

I'll wait until moby/moby#3217 is released.

@crosbymichael

This comment has been minimized.

Copy link
Contributor

crosbymichael commented Dec 17, 2013

its released

@SvenDowideit

This comment has been minimized.

Copy link
Contributor Author

SvenDowideit commented Dec 17, 2013

you guys are awesome. docker is awesome, and boot2docker just makes me grin.

@steeve

This comment has been minimized.

Copy link
Contributor

steeve commented Dec 17, 2013

well that was fast.

okay @SvenDowideit i'm gonna review that first thing in the morning and let you know :)
thank you, that's awesome :)

@helander

This comment has been minimized.

Copy link

helander commented Dec 25, 2013

I have installed boot2docker on hard disk (no vm but a physical machine). I have a boot partition (/dev/sda1) and a data partition to be used for persisting docker state (/dev/sda2). From what I have seen in the code, this would not work, since only the first partition would be checked, is this correct?
Any ideas on how to deal with a configuration like this? TinyCore supports configuration of various disk locations (tce, home, opt, restore) via boot codes, maybe this could be utilized or add a similar boot code for "docker persistence"?

@SvenDowideit

This comment has been minimized.

Copy link
Contributor Author

SvenDowideit commented Dec 29, 2013

heya @tianon and @steeve . I've added some more robustness - there is a new /etc/init.d/docker cleanghosts option that is called at boot time, as rebooting leaves things in a bad state.

do we need more done to release this?

@SvenDowideit

This comment has been minimized.

Copy link
Contributor Author

SvenDowideit commented Dec 29, 2013

@helander can you open a new issue for your use case please - I think we have to think about it in the broader boot2docker context?

@tianon

This comment has been minimized.

Copy link
Contributor

tianon commented Dec 29, 2013

How about, instead of the symlink and the very brute-force Ghosts cleanup, we try adding /usr/local/etc/init.d/docker stop to "/opt/shutdown.sh" like we're supposed to? (see http://wiki.tinycorelinux.net/wiki:bootlocal.sh_and_shutdown.sh)

Also, the "check" function does exactly what your comment describes - it checks to see if Docker is running.

@SvenDowideit

This comment has been minimized.

Copy link
Contributor Author

SvenDowideit commented Dec 30, 2013

@tianon ah, thankyou - though, what happens on a bad shutdown? I kinda feel the brute cleanup needs to be there, because its what docker should be doing on start either way (well, an extended versoin where we test the PID thats in the docker inspect...)

doh - my local test version uses check; - I'll fix that innabit.

@tianon

This comment has been minimized.

Copy link
Contributor

tianon commented Dec 30, 2013

The key part I hear there is "docker should be doing on start" - not some hokey init script for a single platform exhibiting the issue. :)

The real true fix for those issues (beyond stopping Docker cleanly, which is a very important first step), is to have Docker actually verify that Ghosts are or are not still running when it detects them.

@tianon

This comment has been minimized.

Copy link
Contributor

tianon commented Dec 30, 2013

To add just slightly more to that, any manual munging occurring in "/var/lib/docker" is a real serious issue, and should be considered very bad form (like we love saying, you get to keep ALL the pieces).

mkdir -p /mnt/$PARTNAME
mount $BOOT2DOCKER_DATA /mnt/$PARTNAME

if [ -d /mnt/$PARTNAME/vm ]; then

This comment has been minimized.

@tianon

tianon Feb 4, 2014

Contributor
such inconsistent indentation
                                very indented
        many spaces
                                                        should be tabs
wow
@tianon

This comment has been minimized.

Copy link
Contributor

tianon commented Feb 4, 2014

other than very inconsistent indentation throughout, it all seems reasonably sane to me

SvenDowideit added a commit that referenced this pull request Feb 4, 2014

Merge pull request #40 from SvenDowideit/detect-existing-var-lib-dock…
…er-on-hd

new default layout for an empty disk contains ``/var/lib/docker`` and ``/var/lib/boot2docker``, there is still a legacy mode (which I now suspect we shall keep, as its how it would work if you mount a separate partition as ``/var/lib/docker`` in your full OS setup

@SvenDowideit SvenDowideit merged commit 0d61a02 into boot2docker:master Feb 4, 2014

@SvenDowideit SvenDowideit deleted the SvenDowideit:detect-existing-var-lib-docker-on-hd branch Feb 4, 2014

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