Skip to content

Commit bbc8c53

Browse files
committed
1.27.0 release information
1 parent 68b8939 commit bbc8c53

File tree

3 files changed

+69
-23
lines changed

3 files changed

+69
-23
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 1.27.0 (2/28/2020)
2+
3+
### New Features
4+
5+
* Option to set permissions, user and group information for the artifacts included with the `--include-*` parameters.
6+
* Option to overwrite the permissions and ownership info in the optimized image using the new `--path-perms` and `path-perms-file` parameters.
7+
8+
### Improvements
9+
10+
* Option to run the containerized application using user and group information from the USER instruction.
11+
* Filter leftover PID files.
12+
* UX enhancements for the containers created using Dockerfiles.
13+
* Additional debugging information.
14+
15+
### Bug Fixes
16+
17+
* Support for special install directories on Linux (to prevent failures when `docker-slim` is trying to save its state).
18+
119
## 1.26.1 (11/28/2019)
220

321
### Improvements

README.md

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ PHP application images:
7272
Haskell application images:
7373

7474
* (Scotty service) from haskell:8 - 2.09GB => 16.6MB (minified by **125.32X**)
75+
* (Scotty service) from haskell:7 - 1.5GB => 21MB (minified by 71X)
7576

7677
Elixir application images:
7778

@@ -126,16 +127,16 @@ Note: The examples are in a separate repository: [https://github.com/docker-slim
126127

127128
## RECENT UPDATES
128129

129-
Latest version: 1.26.1 (11/28/2019)
130+
Latest version: 1.27.0 (2/28/2020)
130131

131-
Now you can run `docker-slim` in containers and you get more convenient reporting defaults. For more info about the latest release see the [`CHANGELOG`](CHANGELOG.md).
132+
This release has better support for non-default users, an ability to retain the original artifact permissions and to overwrite the container artifact permissions and ownership. For more info about the latest release see the [`CHANGELOG`](CHANGELOG.md).
132133

133134
## INSTALLATION
134135

135136
1. Download the zip package for your platform.
136-
- [Latest Mac binaries](https://downloads.dockerslim.com/releases/1.26.1/dist_mac.zip)
137-
- [Latest Linux binaries](https://downloads.dockerslim.com/releases/1.26.1/dist_linux.tar.gz)
138-
- [Latest Linux ARM binaries](https://downloads.dockerslim.com/releases/1.26.1/dist_linux_arm.tar.gz)
137+
- [Latest Mac binaries](https://downloads.dockerslim.com/releases/1.27.0/dist_mac.zip)
138+
- [Latest Linux binaries](https://downloads.dockerslim.com/releases/1.27.0/dist_linux.tar.gz)
139+
- [Latest Linux ARM binaries](https://downloads.dockerslim.com/releases/1.27.0/dist_linux_arm.tar.gz)
139140
2. Unzip the package.
140141
3. Add the location where you unzipped the package to your PATH environment variable (optional).
141142

@@ -193,7 +194,7 @@ You can use the generated profile with your original image or with the minified
193194

194195
The demo runs on Mac OS X, but you can build a linux version. Note that these steps are different from the steps in the demo video.
195196

196-
1. Get the docker-slim [Mac](https://downloads.dockerslim.com/releases/1.26.1/dist_mac.zip), [Linux](https://downloads.dockerslim.com/releases/1.26.1/dist_linux.tar.gz) or [Linux ARM](https://downloads.dockerslim.com/releases/1.26.1/dist_linux_arm.tar.gz) binaries. Unzip them and optionally add their directory to your PATH environment variable if you want to use the app from other locations.
197+
1. Get the docker-slim [Mac](https://downloads.dockerslim.com/releases/1.27.0/dist_mac.zip), [Linux](https://downloads.dockerslim.com/releases/1.27.0/dist_linux.tar.gz) or [Linux ARM](https://downloads.dockerslim.com/releases/1.27.0/dist_linux_arm.tar.gz) binaries. Unzip them and optionally add their directory to your PATH environment variable if you want to use the app from other locations.
197198

198199
The extracted directory contains two binaries:
199200

@@ -295,11 +296,13 @@ To disable the version checks set the global `--check-version` flag to `false` (
295296
* `--entrypoint` - override ENTRYPOINT analyzing image
296297
* `--cmd` - override CMD analyzing image
297298
* `--mount` - mount volume analyzing image (the mount parameter format is identical to the `-v` mount command in Docker) [zero or more]
298-
* `--include-path` - Include directory or file from image [zero or more]
299-
* `--include-path-file` - Load directory or file includes from a file
299+
* `--include-path` - Include directory or file from image [zero or more] (optionally overwriting the artifact's permissions, user and group information; format: `target:octalPermFlags#uid#gid` ; see the non-default USER FAQ section for more details)
300+
* `--include-path-file` - Load directory or file includes from a file (optionally overwriting the artifact's permissions, user and group information; format: `target:octalPermFlags#uid#gid` ; see the non-default USER FAQ section for more details)
300301
* `--include-bin value` - Include binary from image (executable or shared object using its absolute path)
301302
* `--include-exe value` - Include executable from image (by executable name)
302303
* `--include-shell` - Include basic shell functionality
304+
* `--path-perms` - Set path permissions/user/group in optimized image (format: `target:octalPermFlags#uid#gid` ; see the non-default USER FAQ section for more details)
305+
* `--path-perms-file` - File with path permissions to set (format: `target:octalPermFlags#uid#gid` ; see the non-default USER FAQ section for more details)
303306
* `--env` - override ENV analyzing image [zero or more]
304307
* `--workdir` - override WORKDIR analyzing image
305308
* `--network` - override default container network settings analyzing image
@@ -311,9 +314,16 @@ To disable the version checks set the global `--check-version` flag to `false` (
311314
* `--container-dns-search` - add a dns search domain for unqualified hostnames analyzing image [zero or more]
312315
* `--continue-after` - Select continue mode: enter | signal | probe | timeout or numberInSeconds (default: enter)
313316
* `--dockerfile` - The source Dockerfile name to build the fat image before it's minified.
314-
* `--use-local-mounts` - Mount local paths for target container artifact input and output (off, by default).
317+
* `--use-local-mounts` - Mount local paths for target container artifact input and output (off, by default)
315318
* `--use-sensor-volume` - Sensor volume name to use (set it to your Docker volume name if you manage your own `docker-slim` sensor volume).
316319
* `--keep-tmp-artifacts` - Keep temporary artifacts when command is done (off, by default).
320+
* `--keep-perms` - Keep artifact permissions as-is (true, by default)
321+
* `--run-target-as-user` - Run target app (in the temporary container) as USER from Dockerfile (true, by default)
322+
* `--new-entrypoint` - New ENTRYPOINT instruction for the optimized image
323+
* `--new-cmd` - New CMD instruction for the optimized image
324+
* `--new-expose` - New EXPOSE instructions for the optimized image
325+
* `--new-workdir` - New WORKDIR instruction for the optimized image
326+
* `--new-env` - New ENV instructions for the optimized image
317327

318328
The `--include-path` option is useful if you want to customize your minified image adding extra files and directories. The `--include-path-file` option allows you to load multiple includes from a newline delimited file. Use this option if you have a lot of includes. The includes from `--include-path` and `--include-path-file` are combined together. Future versions will also include the `--exclude-path` option to have even more control.
319329

@@ -503,19 +513,37 @@ If you don't want to create a minified image and only want to "reverse engineer"
503513

504514
### What if my Docker images uses the USER command?
505515

506-
The current version of DockerSlim includes an experimental support for Docker images with USER commands. Please open tickets if it doesn't work for you.
516+
The current version of DockerSlim does include support for non-default users (take a look at the non-default user examples (including the ElasticSearch example located in the `3rdparty` directory) in the [`examples`](https://github.com/docker-slim/examples) repo. Please open tickets if something doesn't work for you.
507517

508-
For older versions of DockerSlim where you have non-default/non-root user declared in your Dockerfile you can use these workarounds to make sure DockerSlim can minify your image:
518+
Everything should work as-is, but for the special cases where the current behavior don't work as expected you can adjust what DockerSlim does using various `build` command parameters: `--run-target-as-user`, `--keep-perms`, `--path-perms`, `--path-perms-file` (along with the `--include-*` parameters).
509519

510-
* Don't add an explicit USER statement in your Dockerfile.
511-
* Explicitly include `/etc/passwd` when you minify your image with DockerSlim (using the `--include-path` docker-slim parameter).
520+
The `--run-target-as-user` parameter is enabled by default and it controls if the application in the temporary container is started using the identity from the USER instruction in the container's Dockerfile.
512521

513-
Example: `docker-slim --debug build --http-probe --include-path /etc/passwd your-docker-image-name`
522+
The `--keep-perms` parameter is also enabled by default. It tells DockerSlim to retain the permissions and the ownership information for the files and directories copied to the optimized container image.
514523

515-
Use an explicit `-u` parameter in docker run.
516-
Example: `docker run -d -u "your-user-name" -p 8000:8000 your-minified-docker-image-name`
524+
The `--path-perms` and `--path-perms-file` parameters are similar to the `--include-path` and `--include-path-file` parameters. They are used to overwrite the permission and the user/group information for the target files and directories. Note that the target files/directories are expected to be in the optimized container image. If you don't know if the target files/directories will be in the optimized container you'll need to use one of the `--include-*` parameters (e.g., `--include-path-file`) to explicitly require those artifacts to be included. You can specify the permissions and the ownership information in the `--include-*` parameters too (so you don't need to have the `--path-*` parameters just to set the permissions).
517525

518-
Note that you should be able to avoid including `/etc/passwd` if you are ok with using UIDs instead of text user name in the `-u` parameter to docker run.
526+
The `--path-*` and `--include-*` params use the same format to communicate the permission/owernship info: `TARGET_PATH_OR_NAME:PERMS_IN_OCTAL_FORMAT#USER_ID#GROUP_ID`.
527+
528+
You don't have to specify the user and group IDs if you don't want to change them.
529+
530+
Here's an example using these parameters to minify the standard `nginx` image adding extra artifacts and changing their permissions: `docker-slim build --include-path='/opt:770#104#107' --include-path='/bin/uname:710' --path-perms='/tmp:700' nginx`.
531+
532+
This is what you'll see in the optimized container image:
533+
534+
```
535+
drwx------ 0 0 0 0 Feb 28 22:15 tmp/
536+
-rwx--x--- 0 0 0 31240 Mar 14 2015 bin/uname
537+
drwxrwx--- 0 104 107 0 Feb 28 22:13 opt/
538+
```
539+
540+
The `uname` binary isn't used by nginx, so the `--include-path` parameter is used to keep it in the optimized image changing its permissions to `710`.
541+
542+
The `/tmp` directory will be included in the optimized image on its own, so the `--path-perms` parameter is used to change its permissions to `700`.
543+
544+
When you set permissions/user/group on a directory the settings are only applied to that directory and not to the artifacts inside. The future versions will allow you to apply the same settings to everything inside the target directory too.
545+
546+
Also note that for now you have to use numeric user and group IDs. The future versions will allow you to use user and group names too.
519547

520548
### Nginx fails in my minified image
521549

internal/app/master/cli.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,35 +350,35 @@ func init() {
350350
doUseNewEntrypointFlag := cli.StringFlag{
351351
Name: FlagNewEntrypoint,
352352
Value: "",
353-
Usage: "New ENTRYPOINT instruction for the minified image",
353+
Usage: "New ENTRYPOINT instruction for the optimized image",
354354
EnvVar: "DSLIM_NEW_ENTRYPOINT",
355355
}
356356

357357
doUseNewCmdFlag := cli.StringFlag{
358358
Name: FlagNewCmd,
359359
Value: "",
360-
Usage: "New CMD instruction for the minified image",
360+
Usage: "New CMD instruction for the optimized image",
361361
EnvVar: "DSLIM_NEW_CMD",
362362
}
363363

364364
doUseNewExposeFlag := cli.StringSliceFlag{
365365
Name: FlagNewExpose,
366366
Value: &cli.StringSlice{},
367-
Usage: "New EXPOSE instructions for the minified image",
367+
Usage: "New EXPOSE instructions for the optimized image",
368368
EnvVar: "DSLIM_NEW_EXPOSE",
369369
}
370370

371371
doUseNewWorkdirFlag := cli.StringFlag{
372372
Name: FlagNewWorkdir,
373373
Value: "",
374-
Usage: "New WORKDIR instruction for the minified image",
374+
Usage: "New WORKDIR instruction for the optimized image",
375375
EnvVar: "DSLIM_NEW_WORKDIR",
376376
}
377377

378378
doUseNewEnvFlag := cli.StringSliceFlag{
379379
Name: FlagNewEnv,
380380
Value: &cli.StringSlice{},
381-
Usage: "New ENV instructions for the minified image",
381+
Usage: "New ENV instructions for the optimized image",
382382
EnvVar: "DSLIM_NEW_ENV",
383383
}
384384

@@ -652,7 +652,7 @@ func init() {
652652
cli.StringFlag{
653653
Name: FlagBuildFromDockerfile,
654654
Value: "",
655-
Usage: "The source Dockerfile name to build the fat image before it's minified",
655+
Usage: "The source Dockerfile name to build the fat image before it's optimized",
656656
EnvVar: "DSLIM_BUILD_DOCKERFILE",
657657
},
658658
doHTTPProbeFlag,

0 commit comments

Comments
 (0)