Skip to content

Instantly share code, notes, and snippets.

@MelissaKaulfuss
Last active January 16, 2018 22:25
Show Gist options
  • Save MelissaKaulfuss/39f77b266445a357d70a7175ac6f298f to your computer and use it in GitHub Desktop.
Save MelissaKaulfuss/39f77b266445a357d70a7175ac6f298f to your computer and use it in GitHub Desktop.
No code in a Docker Image?

The issue

Yesterday when attempting to initialize /.init a Docker Container (for the first time) I got a strange error that I just assumed was down to my set up. Hadn't yet spun this up on my new machine.

The failure occurred when hitting exec bundle exec rake db:create.

The error output:

Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, 
perhaps you meant to add it to your Gemfile?

Pretty baffling?! After a bit of digging, it turns out I had an image without any code in it! cat Gemfile showed it was completely empty!

The solution

I deleted the image and re-pulled to fix this issue.

  • Check out all the images (if you have multiples) docker image list
  • Remove the file from the compose file with the issue docker-compose rm <image-name>
  • Remove the image with it's sha docker image rm <sha>
  • Pull down the image again docker-compose pull <image-name>

Heh, now I have another issue ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment