# Picsolve Docker Builder ## Example config file `.docker-builder.yml` ```yaml --- compose: app_name: hello_world clusters: - dev-1b.kubernetes.picsolve.net - dev-1c.kubernetes.picsolve.net containers: container1: image: docker.picsolve.net/image1 environment: default: - COOL=${variable:cool} - TERM=xterm - "DB_USER=#{variable:db_username}" - "DB_PASSWORD=#{secret:database:password}" - "DB_NAME=#{stage}-#{app_name}" qa: - ENABLE_QA=1 ci: - ENABLE_CI=1 ports: - container_port: 9000 service_port: 9000 requirements: bucket: type: s3bucket database: type: postgres variables: default: cool: yes db_username: dbuser_default ci: db_username: dbuser_ci qa: db_username: dbuser_qa docker: base_image: base-image-name image_name: dest-image-name build_environment: - TERM=xterm build_requirements: bucket: type: s3bucket database: type: postgres dockerfile_hooks: asset_build: early: | RUN touch /tmp/asset_build_earliest_time.txt late: | RUN touch /tmp/asset_build_latest_time.txt docker_build: early: | RUN touch /tmp/docker_build_earliest_time.txt late: | RUN touch /tmp/docker_build_latest_time.txt scala: sbt: build_task: - clean - "universal:packageZipTarball" ``` ## Usage examples ### Building #### Scala ##### Scala app docker image ###### .docker-builder.yml ```yaml docker: base_image: docker.picsolve.net/java-8 image_name: docker.picsolve.net/my-app-name ``` ###### build image `bundle exec rake docker:build` ###### push to registry `bundle exec rake docker:push` ###### for jenkins `bundle exec rake docker:jenkins` ##### Library snapshot build ###### .docker-builder.yml ```yaml docker: base_image: docker.picsolve.net/java-8 image_name: null ssh_auth_forwarding: true ``` ###### build & publish snapshot `bundle exec rake scala:lib:snapshot` ###### build & publish release `bundle exec rake scala:lib:release` ## Release process This gem is released publicly to Rubygems repositories. To trigger a release you have to do the following steps: ```shell # Ensure all the tests are running bundle exec rake test_integration # Release to rubygems (account information is in the Vault) bundle exec rake release ```