diff:
```patch
diff --git a/Makefile b/Makefile
index 0b2b063..70df01b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+GIT_VERSION := $(shell git describe --abbrev=40 --long --dirty --always --tags)
all:
- gcc -O2 -o init -static grimes.c
+ gcc -O2 -DVERSION=\"$(GIT_VERSION)\" -o init -static grimes.c
diff --git a/grimes.c b/grimes.c
index d0f836b..ffeea98 100644
--- a/grimes.c
+++ b/grimes.c
@@ -29,7 +29,7 @@ typedef struct reaper_t {
} reaper_t;
// reaper_new initializes the reaper with the provided process.
-// it also sets up the signal handlers and child handlers for restore
+// it also sets up the signal handlers and child handlers for restore
// when the child is execed
int reaper_new(reaper_t * reaper, process_t * process)
{
@@ -57,7 +57,7 @@ int reaper_new(reaper_t * reaper, process_t * process)
return 0;
}
-// reaper_exit closes the reaper's signalfd and exits with the
+// reaper_exit closes the reaper's signalfd and exits with the
// child's exit status
void reaper_exit(reaper_t * reaper, int status)
{
@@ -68,11 +68,11 @@ void reaper_exit(reaper_t * reaper, int status)
exit(WEXITSTATUS(status));
}
-// reaper_reap reaps any dead processes. If the process that is reaped
+// reaper_reap reaps any dead processes. If the process that is reaped
// is the child process that we spawned get its exit status and exit this program
int reaper_reap(reaper_t * reaper)
{
- int status, child_exited, child_status = 0;
+ int status = 0, child_exited = 0, child_status = 0;
for (;;) {
pid_t pid = waitpid(-1, &status, WNOHANG);
switch (pid) {
@@ -140,6 +140,12 @@ int main(int argc, char **argv)
{
process_t process;
reaper_t reaper;
+
+ if (argc == 2 && !strcmp(argv[1], "--version")) {
+ printf("grimes version %s\n", VERSION);
+ exit(0);
+ }
+
if (reaper_new(&reaper, &process) != 0) {
bail("initialize reaper %s", strerror(errno));
}
```
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This fix tries to address the issue raised in 27969 where
duplicate identical bind mounts for `docker run` caused additional volumes
to be created.
The reason was that in `runconfig`, if duplicate identical bind mounts
have been specified, the `copts.volumes.Delete(bind)` will not truly
delete the second entry from the slice. (Only the first entry is deleted).
This fix fixes the issue.
An integration test has been added to cover the changes
This fix fixes 27969.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Previously, when the graphdir was a root of a mountpoint, we would not
be able to cleanup the graphdir, as the script would umount in case
target dir is a mount itself
```/etc/mtab
/dev/xvdc1 /var/lib/docker btrfs
```
When running the script, the graphdir would be unmounted and it would
remove a (possibly) empty folder.
```
Nuking /var/lib/docker ...
(if this is wrong, press Ctrl+C NOW!)
+ sleep 10
+ umount -f /var/lib/docker
+ rm -rf /var/lib/docker
```
This PR includes the necessary changes to nuke the folder on this
scenario, including when the graphdir is a btrfs mount iself.
Signed-off-by: Bruno Tavares <btavare@thoughtworks.com>
RWLayers do not implement the tar stream from, moved the
definition to Layer instead of TarStreamer
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Allow built images to be squash to scratch.
Squashing does not destroy any images or layers, and preserves the
build cache.
Introduce a new CLI argument --squash to docker build
Introduce a new param to the build API endpoint `squash`
Once the build is complete, docker creates a new image loading the diffs
from each layer into a single new layer and references all the parent's
layers.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
These features were originally scheduled
for removal in docker 1.13, but we changed
our deprecation policy to keep features
for three releases instead of two.
This updates the deprecation version
to match the deprecation policy.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
In file `api/types/client.go`, some of the "*Options{}" structs own a
`Filters` field while some else have the name of `Filter`, this commit
will rename all `Filter` to `Filters` for consistency. Also `Filters`
is consistent with API with format `/xxx?filters=xxx`, that's why
`Filters` is the right name.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>