I thought docker images worked independent of the OS and did not need any dependencies installed on the OS itself.
I have a docker image built using the dockerfile:
FROM ubuntu:16.04
# Prepare to install Java for 'rjb' gem
RUN apt-get update && apt-get -y install software-properties-common && add-apt-repository ppa:webupd8team/java -y && apt-get update
# Install Java 8 and accept the license by default (https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04)
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && apt-get -y install oracle-java8-installer && java -version
# Set JAVA_HOME (should add in the docker startup script)
RUN echo 'export JAVA_HOME="/usr/lib/jvm/java-8-oracle"' >> /etc/environment && . /etc/environment && echo $JAVA_HOME
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
# Install curl, rvm, ruby 2.1.5p273, rails 4.2.6
RUN apt-get -y update && apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev && apt-get -y install wget && apt-get install -y ruby-full && ruby -v && gem install rails -v 4.2.6 && rails -v
# Install bundler, git
RUN gem install bundler && apt-get -y install git
ENV DEBIAN_FRONTEND noninteractive
# Make sure 'bundle install' run successfully and set the git pre-commit hooks
RUN ["/bin/bash", "-c", "cd home && mkdir expertiza_developer && cd expertiza_developer && git clone https://github.com/expertiza/expertiza.git && cd expertiza && apt-get -y install ruby-dev && apt-get -y install make && apt-get install -y gcc make && apt-get install -y libmysqlclient-dev && apt-get install -y libpq-dev && bundle install && debconf-set-selections <<< 'mysql-server mysql-server/root_password password ' && debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password ' && apt-get -y install mysql-server && /etc/init.d/mysql start && cp config/database.yml.example config/database.yml && cp config/secrets.yml.example config/secrets.yml && mv ./hooks/pre-commit ./.git/hooks/pre-commit && chmod 755 ./.git/hooks/pre-commit"]
and using the following docker-compose file to run the image:
version: '3'
services:
expertiza:
image: winbobob/expertiza:test
ports:
- '3000:3000'
volumes:
- '.:/root/expertiza'
depends_on:
- scrubbed_db
- redis
links:
- scrubbed_db
- redis
working_dir: /root/expertiza
command: bundle exec thin start -p 3000
environment:
REDIS_HOST: redis
scrubbed_db:
image: mysql:5.7
volumes:
# https://stackoverflow.com/questions/25920029/setting-up-mysql-and-importing-dump-within-dockerfile
- './docker/scrubbed_db:/docker-entrypoint-initdb.d'
environment:
MYSQL_ROOT_PASSWORD: expertiza
redis:
image: redis:alpine
This runs perfectly fine on an Ubuntu 16.04 box, but when I run this same image on an Ubuntu 18.04 box, I get the following error:
expertiza_1 | /var/lib/gems/2.3.0/gems/bundler-1.16.4/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find rubyzip-1.2.2 in any of the sources (Bundler::GemNotFound)
Does anyone know why this is happening and how to fix it?