- uses: actions/checkout@v2
with:
fetch-depth: 1
- - name: build base image
+ - name: build slim image
+ run: |
+ cd image && ruby auto_build.rb base_slim
+ - name: build release image
run: |
cd image && ruby auto_build.rb base
- name: build test_build image
- name: run specs
run: |
docker run --rm -e RUBY_ONLY=1 -e USE_TURBO=1 -e SKIP_PLUGINS=1 -e SKIP_LINT=1 discourse/discourse_test:build
+ - name: tag images
+ run:
+ TAG=`date +%Y%m%d-%H%M`
+ docker tag discourse/base:build discourse/base:2.0.$TAG-slim
+ docker tag discourse/base:build discourse/base:slim
+ docker tag discourse/base:build discourse/base:2.0.$TAG
+ docker tag discourse/base:build discourse/base:release
+ - name: Print summary
+ run: |
+ docker images discourse/base
- name: push to dockerhub
if: success() && (github.ref == 'refs/heads/main')
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |
- TAG=`date +%Y%m%d-%H%M`
- docker tag discourse/base:build discourse/base:2.0.$TAG
- docker tag discourse/base:build discourse/base:release
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
- docker push discourse/base:release
+ docker push discourse/base:2.0.$TAG-slim
+ docker push discourse/base:slim
docker push discourse/base:2.0.$TAG
+ docker push discourse/base:release
test:
runs-on: [ubuntu-20.04]
needs: base
uses: docker/setup-buildx-action@v1
- name: build base image for aarch64
run: |
- cd image/base && docker buildx build . --platform linux/arm64 --load --tag discourse/base:aarch64
+ cd image/base
+ docker buildx build . -f slim.Dockerfile --platform linux/arm64 --load --tag discourse/base:aarch64-slim
+ docker buildx build . -f release.Dockerfile --platform linux/arm64 --load --tag discourse/base:aarch64 --build-arg tag=aarch64-slim
- name: push to dockerhub
if: success() && (github.ref == 'refs/heads/main')
env:
require 'optparse'
images = {
- base: { name: 'base', tag: "discourse/base:build", squash: true },
+ base_slim: { name: 'base', tag: "discourse/base:build_slim", squash: true, extra_args: '-f slim.Dockerfile' },
+ base: { name: 'base', tag: "discourse/base:build", extra_args: '-f release.Dockerfile' },
discourse_test_build: { name: 'discourse_test', tag: "discourse/discourse_test:build", squash: false},
discourse_test_public: { name: 'discourse_test', tag: "discourse/discourse_test:release", squash: true, extra_args: ' --build-arg tag=release '},
discourse_dev: { name: 'discourse_dev', tag: "discourse/discourse_dev:build", squash: false },
--- /dev/null
+ARG tag=build_slim
+
+FROM discourse/base:$tag
+
+RUN cd /var/www/discourse &&\
+ sudo -u discourse bundle install --deployment --jobs 4 --without test development &&\
+ sudo -u discourse yarn install --production &&\
+ sudo -u discourse yarn cache clean &&\
+ bundle exec rake maxminddb:get &&\
+ find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +
git clone --depth 1 https://github.com/discourse/discourse.git &&\
cd discourse &&\
git remote set-branches --add origin tests-passed &&\
- chown -R discourse:discourse /var/www/discourse &&\
- cd /var/www/discourse &&\
- sudo -u discourse bundle install --deployment --jobs 4 --without test development &&\
- sudo -u discourse yarn install --production &&\
- sudo -u discourse yarn cache clean &&\
- bundle exec rake maxminddb:get &&\
- find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +
+ chown -R discourse:discourse /var/www/discourse