Browse Source

Adding famfamfam icons for docker w/ symlink

denney-docker
Jason Denney 9 years ago
parent
commit
bc6802e5fb
  1. 1
      .gitignore
  2. 3
      Dockerfile
  3. 19
      install_famfamfam.rb
  4. 1
      public/images/icons

1
.gitignore

@ -7,5 +7,4 @@ tmp/
.rbenv-version .rbenv-version
.DS_Store .DS_Store
public/assets public/assets
public/images/icons
config/database.yml config/database.yml

3
Dockerfile

@ -19,5 +19,8 @@ RUN bundle install
COPY install_extjs.rb /usr/src/app/ COPY install_extjs.rb /usr/src/app/
RUN /usr/src/app/install_extjs.rb RUN /usr/src/app/install_extjs.rb
COPY install_famfamfam.rb /usr/src/app/
RUN /usr/src/app/install_famfamfam.rb
EXPOSE 3000 EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"] CMD ["rails", "server", "-b", "0.0.0.0"]

19
install_famfamfam.rb

@ -0,0 +1,19 @@
#!/usr/bin/env ruby
require 'fileutils'
fam_url = "http://www.famfamfam.com/lab/icons/silk/famfamfam_silk_icons_v013.zip"
download_dir = '/tmp'
dest_dir = "/usr/lib/famfamfam"
fam_download_path = File.join(download_dir,'famfamfam_silk_icons_v013.zip')
files = Dir.glob(File.join(dest_dir, '*'))
if files.empty? and Dir.glob(fam_download_path).empty?
`wget -P #{download_dir} #{fam_url}`
raise "Failed downloading #{fam_url}" if Dir.glob(fam_download_path).empty?
end
if files.empty?
puts `unzip #{fam_download_path} -d #{dest_dir}/`
end
raise "Failed unzipping #{fam_download_path}" if Dir.glob(File.join(dest_dir, '*')).empty?

1
public/images/icons

@ -0,0 +1 @@
/usr/lib/famfamfam/icons/
Loading…
Cancel
Save