After a previous post it was suggested to create my own Docker image, I wanted to have jenkins with ruby, so my dockerfile looks like
FROM jenkins
FROM ruby:2.3.0
I run docker build -t jenkins_ruby .
It builds correctly and i can see the image when i do docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
jenkins latest 77bd697ef2c3 5 days ago 710.1 MB
jenkins_ruby latest 1653f4c3a826 8 days ago 729 MB
ruby latest 1653f4c3a826 8 days ago 729 MB
So i then want to run this image in a container docker run -p 8080:8080 jenkins_ruby
but i get Switch to inspect mode.
I was expecting to be able to go to ipaddress:8080
and see the jenkins console
Have i missed something?
Thanks
A Dockerfile cannot have multiple
FROM
s.This type of functionality to essentially merge two images together cannot be done in a single Dockerfile. All that's really happening here is that it will pull the
jenkins:latest
image, pull theruby:2.3.0
image and then tag theruby
image withjenkins_ruby
. There is no merging occurring, you can see that with the image final sizes too,jenkins_ruby
has an identical size toruby
.There's a Github issue to back this up here.