[ 
https://issues.apache.org/jira/browse/CASSANDRA-16419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yifan Cai updated CASSANDRA-16419:
----------------------------------
    Test and Documentation Plan: adhoc test
                         Status: Patch Available  (was: Open)

Talked with [~mck] on slack. It makes sense to add the option {{--all}} to the 
prune commands.

PR: [https://github.com/apache/cassandra-builds/pull/36]

Manually tested running prune with and w/o {{--all}}.
{code:java}
➜ docker build --build-arg 
CASSANDRA_GIT_URL=https://github.com/yifan-c/cassandra.git -t 
cassandra-artifacts-centos7:f97909037e19d0f1b2c6692ef8c79ce042058558 -f 
docker/centos7-image.docker docker/
...
Successfully built 3b3098e54313
Successfully tagged 
cassandra-artifacts-centos7:f97909037e19d0f1b2c6692ef8c79ce042058558

➜ docker run 
cassandra-artifacts-centos7:f97909037e19d0f1b2c6692ef8c79ce042058558 sleep 
10000 &

➜ docker ps
CONTAINER ID   IMAGE                                                            
      COMMAND         CREATED         STATUS         PORTS     NAMES
78c3dbf3e6a2   
cassandra-artifacts-centos7:f97909037e19d0f1b2c6692ef8c79ce042058558   "sleep 
10000"   4 seconds ago   Up 2 seconds             romantic_cartwright

# Won't remove, since the image is not dangling.
➜ docker image prune --force --filter "label=org.cassandra.buildenv=centos"
Total reclaimed space: 0B

# Won't remove, since the image is being used by container '78c3dbf3e6a2'
➜ docker image prune --all --force --filter 
"label=org.cassandra.buildenv=centos"
Total reclaimed space: 0B

# Now stop and remove the container.
➜ docker stop 78c3dbf3e6a2

➜ docker rm 78c3dbf3e6a2

# Won't remove, since the image is not dangling. 
➜ docker image prune --force --filter "label=org.cassandra.buildenv=centos"
Total reclaimed space: 0B

# Remove the unused image with --all
➜ docker image prune --all --force --filter 
"label=org.cassandra.buildenv=centos"
Deleted Images:
untagged: cassandra-artifacts-centos7:f97909037e19d0f1b2c6692ef8c79ce042058558
deleted: sha256:3b3098e54313384eddd86223ffcfc007b329c6ac37e24abda3e617cde3992177
...
Total reclaimed space: 1.406GB
{code}

> Cassandra-builds should remove the unused docker images in Jenkins
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-16419
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16419
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Build, CI
>            Reporter: Yifan Cai
>            Assignee: Yifan Cai
>            Priority: Normal
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The docker `prune` commands used in the Jenkins builds only remove the 
> dangling images. What we are expecting is to remove the unused ones as well. 
> The commands currently used are missing the option `-a | --all`.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to