diff --git a/Dockerfile b/Dockerfile index dfbacf7..601ec38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,13 +5,20 @@ ENV FACTER_VERSION 2.4.6 # Install any dependencies needed RUN apk update && \ apk add bash sed dmidecode ruby ruby-irb open-lldp util-linux open-vm-tools sudo && \ - apk add lshw ipmitool --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted && \ - echo "install: --no-rdoc --no-ri" > /etc/gemrc && \ + apk add lshw --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted + +RUN echo "install: --no-rdoc --no-ri" > /etc/gemrc && \ + echo ":ssl_verify_mode: 0" >> /etc/gemrc && \ gem install json_pure daemons && \ - gem install facter -v ${FACTER_VERSION} && \ - find /usr/lib/ruby/gems/2.2.0/gems/facter-${FACTER_VERSION} -type f -exec sed -i 's:/proc/:/host-proc/:g' {} + && \ - find /usr/lib/ruby/gems/2.2.0/gems/facter-${FACTER_VERSION} -type f -exec sed -i 's:/dev/:/host-dev/:g' {} + && \ - find /usr/lib/ruby/gems/2.2.0/gems/facter-${FACTER_VERSION} -type f -exec sed -i 's:/host-dev/null:/dev/null:g' {} + && \ - find /usr/lib/ruby/gems/2.2.0/gems/facter-${FACTER_VERSION} -type f -exec sed -i 's:/sys/:/host-sys/:g' {} + + gem install facter -v ${FACTER_VERSION} + +RUN find /usr/lib/ruby/gems/2.3.0/gems/facter-${FACTER_VERSION} -type f -exec sed -i 's:/proc/:/host-proc/:g' {} + && \ + find /usr/lib/ruby/gems/2.3.0/gems/facter-${FACTER_VERSION} -type f -exec sed -i 's:/dev/:/host-dev/:g' {} + && \ + find /usr/lib/ruby/gems/2.3.0/gems/facter-${FACTER_VERSION} -type f -exec sed -i 's:/host-dev/null:/dev/null:g' {} + && \ + find /usr/lib/ruby/gems/2.3.0/gems/facter-${FACTER_VERSION} -type f -exec sed -i 's:/sys/:/host-sys/:g' {} + + +ADD pkg/ipmitool.tgz / + ADD hnl_mk*.rb /usr/local/bin/ ADD hanlon_microkernel/*.rb /usr/local/lib/ruby/hanlon_microkernel/ + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..63c628a --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +TAG?=test +IMAGENAME?=jtilander/hanlon-microkernel + +image: + docker build -t $(IMAGENAME):$(TAG) . + +push: image + docker push $(IMAGENAME):$(TAG) + +save: + docker save $(IMAGENAME):$(TAG) > cscdock-mk-image.tar + bzip2 -c cscdock-mk-image.tar > /tmp/cscdock-mk-image.tar.bz2 + rm cscdock-mk-image.tar diff --git a/README.md b/README.md index e0e53b9..c0a06f3 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,15 @@ This project contains the Ruby scripts/classes that are used to control the Hanl In addition, this project also includes a number of additional ruby files and configuration files that are used by these services, and the 'hnl_mk_init.rb' script itself (which is used to start the appropriate Ruby-based services during the Microkernel boot process). It should be noted that this project also includes a Dockerfile that is used to build a new instance of the Microkernel container. Instructions for building your own (custom) Microkernel container can be found in the project's Wiki. + + + +## Patches + +This project seems a little bit out of date so there were a couple of problems with building it that was fixed: + +* Certificates for gems out of date, disabled verification for now +* ipmitool has fallen out of alpine distro, used https://github.com/urzds/ipmitool-docker to build the pkg/ipmitool.tgz file +* Source repro for lshw changed from testing to community (presumably due to the same circumstances as for ipmitool) +* Gems install version changed to 2.3.0 + diff --git a/pkg/ipmitool.tgz b/pkg/ipmitool.tgz new file mode 100644 index 0000000..fde510d Binary files /dev/null and b/pkg/ipmitool.tgz differ