Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Kyle Quest
    @kcq
    @malys yes, the trick there is to leverage already shared folders, but it makes it more complex than it should be
    @mrmason i'll have more to share soon, sorry about the delay Tom
    Kyle Quest
    @kcq
    Tom, can you check if you have 'docker-slim-sensor' in the '/usr/local/bin' directory on your host machine
    Srikant
    @srikantpatnaik

    Great tool, guys!
    I just need a pointer on my output.
    My image contains custom headless chrome(CEF), docker-slim minifies it well, but I run my container it crashes after sometime when I access my container with the following error:

    [0100/000000.789662:ERROR:zygote_linux.cc(614)] Zygote could not fork: process_type renderer numfds 5 child_pid -1
    [0100/000000.791877:ERROR:zygote_linux.cc(646)] write: Broken pipe (32)
    /opt/distrib/init.sh: line 10: 10 Trace/breakpoint trap (core dumped) $PWD/my_browser --no-sandbox --disable-gpu --disable-gpu-compositing

    my build cmd:
    sudo ./docker-slim build --include-path=/tmp --include-path=/opt/distrib --include-bin=/bin/busybox --tag abc-slim:v1 --http-probe=false abc-fat:v1
    It seems the chrome couldn't create the forks
    Srikant
    @srikantpatnaik
    my docker run cmd:
    docker run --cap-add=SYS_NICE --shm-size=2048m --entrypoint=/bin/bash -e "ABC_SERVER=192.168.122.11" -e "ABC_PORT=80" --rm --cap-add=SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup:ro --name abc -p 1200:1200 --device /dev/snd abc-slim:v1 /opt/distrib/init.sh
    Malys
    @malys
    @kcq Last version works like a charm in dind mode. Great job and thx you
    Kyle Quest
    @kcq
    @malys are you using it in a cloud CI environment or are you doing it locally?
    Malys
    @malys
    @kcq in GITLAB CI on premise, I don't use docker image. Currently, I download binaries in my container which is running my job and works fine.
    Kyle Quest
    @kcq
    @malys great to hear it works with your on prem Gitlab environment! got a chance to test it only with the standard Gitlab CI setup and that environment requires a bit of work to configure the DOCKER_HOST environment variable properly (i added the instructions to the readme, just in case)
    Kyle Quest
    @kcq
    @srikantpatnaik Thank you for sharing your use case! Haven't had a chance to explore a similar Docker image setup... Is there a Dockerfile you could share to see if I can repro the condition?
    @srikantpatnaik Also curious what you are doing with /dev/snd in your container
    Srikant
    @srikantpatnaik
    @kcq thanks for taking this up. I will share my dockerfile in sometime. The /dev/snd isn't needed anymore
    atiqtahir
    @atiqtahir
    Hi
    How to pass environment variable to docker-slim using --env flag?
    Kyle Quest
    @kcq
    @atiqtahir yes
    atiqtahir
    @atiqtahir
    Thanks
    Nischal
    @nischalhp
    Hello Team
    We are evaluating docker-slim with our containers and hope to add it to our CI/CD pipeline in case its successful.
    The question I have is, how to pass arguments to docker-slim command that is required to start the container. From my understanding, docker-slim brings up the docker image, runs a probe to understands how to minimize. When it does try to start the container, certain arguments are required for the container to startup and it would be great if one of you could shed light on it.
    @kcq
    Kyle Quest
    @kcq
    @nischalhp which docker run parameters do you need?
    Kyle Quest
    @kcq
    You can already pass a few different runtime parameters to mount a volume and to pass environment variable, for example.
    Nischal
    @nischalhp
    @kcq yes those are the kind we want to pass as well, could you point me to documentation for the same?
    Kyle Quest
    @kcq
    @nischalhp "--mount" is similar to the "-v" option in docker run
    "--env" is similar to the "-e" option
    you can also specify a custom network to use with the "--network" flag
    or a custom link with "--link"
    you can set the working directory with the "--workdir" flag
    you can also expose ports (in case you don't have the EXPOSE instructions in your Dockerfile) with the "--expose" flag
    "--hostname" can be used to set the hostname for the temporary container
    if you want to add records to /etc/hosts you can use the "--etc-hosts-map" flag
    there's also "--container-dns" and "--container-dns-search" for the dns related configurations
    Nischal
    @nischalhp
    Okay, wonderful, thank you @kcq . Will keep posted here the findings from using dockerslim.
    David Delabassée
    @delabassee_twitter

    docker-slim build always fails with any of the Go samples untouched. Fwiw, it also fails with my own container ;-)

    info=container status=created name=dockerslimk_51426_20191211150105 id=585c79c09a5481a7967948391876a49f67e251f6ee19e618f72ab0fa6e649f01
    docker-slim[build]: info=container status=crashed id=585c79c09a5481a7967948391876a49f67e251f6ee19e618f72ab0fa6e649f01
    docker-slim: container stdout:
    docker-slim: container stderr:
    standard_init_linux.go:211: exec user process caused "exec format error"

    I'm on OSX (10.13.6 (17G10021)) with Docker 19.03.5.
    Any idea?

    Xiang Zhou
    @ZhouBox
    #- docker build --add-host registry.weihong.com.cn:172.16.11.19 --pull -t $COMMIT_IMAGE .
    - docker-slim build --show-blogs=true --etc-hosts-map registry.weihong.com.cn:172.16.11.19 --from-dockerfile Dockerfile --tag $CI_COMMIT_SHA.slim .
    when i use docker build ,it is ok
    but i use docker-slim,request to http://registry.weihong.com.cn/minimist failed, reason: getaddrinfo ENOTFOUND registry.weihong.com.cn registry.weihong.com.cn:80
    no found registry.weihong.com.cn
    what i can do?
    Xiang Zhou
    @ZhouBox
    when my app in image use /tmp, docker-slim rm the '/tmp' path,so what I can do it?
    I use --include-path, but it no work
    Mr Docker
    @mr.docker_gitlab
    i'm using java, mvn, gradle, node and python beneath oracle linux as a base image, all built in into a one docker image that has around 2 gb of size.. no http-probes and no port exports..
    tried to fire docker-slim into that image but it gave around 3 mb image that has a nothing inside.
    @jasperamorgan_gitlab has similar issue of the one I have..
    my point is how to get the 2gb image smaller and faster with docker-slim.
    otaconix
    @otaconix
    Hey everyone. I'm trying to run docker-slim from within docker (using the image from docker hub, dslim/docker-slim), but I'm running into issues: docker-slim can't seem to perform its HTTP probes because the connections are being refused. When running the exact same docker-slim build command on the host, everything works fine. Am I overlooking some crucial flag I should be using when running docker-slim from within docker?
    otaconix
    @otaconix
    https://gist.github.com/otaconix/397ff08558c098631b73499472bd7391 This gist should contain all that's necessary to reproduce my issue
    otaconix
    @otaconix
    Never mind, I'm a little dumb... I didn't realize it's still the docker daemon on my host doing the mounting of bind volumes, so there's no need to first bind-mount into the docker-slim container, to then forward that mount into the container for the fat image!
    Kyle Quest
    @kcq
    @delabassee_twitter sorry for the headaches! I wonder where you installed docker-slim on your Mac... What's the directory name? Can you also run file docker-slim-sensor in that directory to see the system architecture for the sensor executable. Can you also share the output when you run docker-slim version?
    Kyle Quest
    @kcq
    @ZhouBox I assume registry.weihong.com.cn is referenced in your Dockerfile somehow, right? If this is the case it's a gap in functionality right now... The --etc-hosts-map value is only applied at runtime when the image is minified (it's not used when the image is build like it would happen with docker build --add-host. I'll open a Github issue to track this enhancement. Thank you for sharing your use case!
    @ZhouBox Can you share the full docker-slim command line when you are trying to use the --include-path parameter? It'll help reproducing the condition.
    Kyle Quest
    @kcq
    @mr.docker_gitlab are you trying to minify a base image or do you have your application (or a set of applications) in that image? What's the purpose/function of that image? Minifying base images with docker-slim is technically possible, but it requires extra effort and you need to use the --include-* params like --include-path, --include-bin and --include-exe parameters for docker-slim to specify explicitly what you want to keep. There's a future enhancement that will help with minifying base images (ability to minify images specifying multiple command line applications you want to keep). I'll be happy to ping you when it's available and it'll be super if you have cycles to work on this feature if you'd like to see it sooner :)