Unable to remove docker image

I've been playing around with building Docker images and noticed I had a few that had <none> as both the repository and tag info.

% docker images

REPOSITORY                 TAG                 IMAGE ID	...

<none>                     <none>              c1e0e48a03bb  
<none>                     <none>              c8bf15029bc0 

I tried to delete these untagged images, but couldn't.

% docker rmi c1e0e48a03bb
Error response from daemon: Conflict, cannot delete c1e0e48a03bb because the container 5f266c452a8b is using it, use -f to force

Ok, so we'll try to force deletion.

% docker rmi -f c1e0e48a03bb
Error response from daemon: No such id: b5dc67806c5f1e4abfa079a1c99f6d782e5696a25a3c9beb16043fe2e7164d19
2014/10/18 10:04:27 Error: failed to remove one or more images

Mmm ... the original message said the image couldn't be deleted because it was in use by a container. I didn't have any running containers as I verified by doing docker ps. But the issue is that docker holds on to images even from exited containers. Once you realize that, then this becomes much easier to resolve.

To delete all your exited containers.

% docker ps -a -q --filter "status=exited" | xargs docker rm

And to then delete all your untagged images.

% docker rmi `docker images -q --filter "dangling=true"`

tags: docker

Comments

Apple touch inconsistency

Apple is really known for their user interface design. I'd say they generally have a lot more hits than misses, but one miss recently came as a surprise for me.

Take an iPhone, go to the Settings screen. Scroll the screen with your finger. Notice that the text moves in the direction of your fingers and the scrollbar moves in the opposite direction. The paradigm is that your finger is controlling the text, directly moving it. The scrollbar is just illustrative to let you know how far you are in the document.

Now take a Macbook or Macbook Pro with a multitouch trackpad. Use two fingers to scroll a webpage or other window that has a scrollbar. Notice that this time the text moves in the opposite direction of your stroke, while the scrollbar moves in the same direction as your fingers. The paradigm here is that your fingers control the scrollbar, which then inversely moves the text. One might say this method is indirect control.

So that's kind of strange. Two Apple devices using touch in entirely different and opposite ways. One going for direct control and the other indirect. This inconsistency could be Apple experimenting with touch user interface concepts or just be a result of legacy user interface design. But whatever the reason, they will someday have to make a choice.

As we head towards a future in which iPhone apps and OSX apps merge and play together on a singular device - possibly the fabled touch tablet - Apple will have to decide which of the touch paradigms will live on. Which one will it be?

Comments

Error installing Haskell X11 libs

I recently bought a new Macbook Pro and with the recent announcment of GHC 6.10.1, I thought it was time to install the latest GHC and libs. Previously I had some trouble installing the Haskell X11 libs on Leopard, but I thought something might have been borked on my old laptop. With this new one and starting from scratch, I hoped things would go smoothly. Twas not to be.

The X11 libraries are installed under /usr/X11/lib.

bash-3.2$ locate libX11
/Applications/CrossOver Games.app/Contents/SharedSupport/X11/lib/libX11.6.2.dylib
/Applications/CrossOver Games.app/Contents/SharedSupport/X11/lib/libX11.6.dylib
/Applications/CrossOver Games.app/Contents/SharedSupport/X11/lib/libX11.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.6.2.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.6.dylib
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.a
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.6.2.0.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.6.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.dylib
/opt/local/var/macports/sources/rsync.macports.org/release/ports/x11/xorg-libX11
/opt/local/var/macports/sources/rsync.macports.org/release/ports/x11/xorg-libX11/Portfile
/usr/X11/lib/libX11.6.2.0.dylib
/usr/X11/lib/libX11.6.dylib
/usr/X11/lib/libX11.dylib
/usr/X11/lib/libX11.la

I've fallen down and I can't get up

Here are some things I tried that didn't work.

  • Try adding an entry for extra-lib-dirs to X11.cabal
  • A FAQ entry for XMonad offers up some helpful tips to try.

    extra-lib-dirs:     /usr/X11/lib
    
    

    and try to configure ...

    bash-3.2$ runhaskell Setup.hs configure
    
    checking for X... no
    configure: error: X11 libraries not found, so X11 package cannot be built
    See `config.log' for more details.
    
    

  • Try passing option to configure
  • bash-3.2$ runhaskell Setup.hs configure --extra-lib-dirs=/usr/X11/lib
    
    checking for X... no
    configure: error: X11 libraries not found, so X11 package cannot be built
    See `config.log' for more details.
    
    

  • Try setting LD_LIBRARY_PATH
  • bash-3.2$ export LD_LIBRARY_PATH=/usr/X11/lib; runhaskell Setup.hs configure
    
    checking for X... no
    configure: error: X11 libraries not found, so X11 package cannot be built
    See `config.log' for more details.
    
    

  • Try setting DYLD_LIBRARY_PATH
  • bash-3.2$ export DYLD_LIBRARY_PATH=/usr/X11/lib; runhaskell Setup.hs configure
    
    checking for X... no
    configure: error: X11 libraries not found, so X11 package cannot be built
    See `config.log' for more details.
    
    

  • Try setting DYLD_FALLBACK_LIBRARY_PATH
  • bash-3.2$ export DYLD_LIBRARY_PATH=/usr/X11/lib
    bash-3.2$ runhaskell Setup.hs configure
    
    Setup.hs:3:0:
        Warning: In the use of `defaultUserHooks'
                 (imported from Distribution.Simple):
                 Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
                 compatibility in which case you must stick with defaultUserHooks"
    Setup.hs: &lt;command line&gt;: can't load .so/.DLL for: dl (dlopen(libdl.dylib, 9): image not found)
    
    

It's a bit disappointing how different OSX is from the Linux distros. Yeah it doesn't suck like Windows, but even so I wish it weren't so different from Linux.

So what did work?

Just like in my previous article, using the LDFLAGS variable solves the problem.

bash-3.2$ export LDFLAGS=-L/usr/X11/lib; runhaskell Setup.hs configure

Setup.hs:3:0:
    Warning: In the use of `defaultUserHooks'
             (imported from Distribution.Simple):
             Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
             compatibility in which case you must stick with defaultUserHooks"
Warning: defaultUserHooks in Setup script is deprecated.
Configuring X11-1.4.4...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers 
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking whether to build Xinerama... yes
checking for egrep... grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking X11/extensions/Xinerama.h usability... yes
checking X11/extensions/Xinerama.h presence... yes
checking for X11/extensions/Xinerama.h... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating X11.buildinfo
config.status: creating include/HsX11Config.h
config.status: creating include/X11_extras_config.h

tags: haskell, osx, x11

Comments