Skip to content

Commit

Permalink
Merge pull request #1 from hybsearch/docker
Browse files Browse the repository at this point in the history
Add Dockerfile and build on CircleCI
  • Loading branch information
hawkrives authored Mar 15, 2018
2 parents 8d62dc3 + 569f923 commit 4c90594
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
version: 2

workflows:
version: 2
on_commit:
jobs:
- build:
context: docker-hub
on_tag:
jobs:
- build:
context: docker-hub
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/

jobs:
build:
docker:
- image: circleci/buildpack-deps:stretch-scm
environment:
LOCAL_NAME: hybsearch/clustal
DEST_NAME: docker.io/hybsearch/clustal
steps:
- checkout
- setup_remote_docker
- run:
name: 'Build docker image'
command: |
docker build -t "$LOCAL_NAME:$CIRCLE_SHA1" .
- run:
name: 'Print debugging branch/tag information'
command: |
echo "CIRCLE_BRANCH: $CIRCLE_BRANCH" "CIRCLE_TAG: $CIRCLE_TAG"
- run:
name: 'Log in to docker'
command: |
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- run:
name: 'Push to Docker Hub'
command: |
image_id="$(docker images -q "$LOCAL_NAME:$CIRCLE_SHA1")"
echo "image_id: $image_id"
if [[ $CIRCLE_BRANCH = master ]]; then
docker_tag="$DEST_NAME:HEAD"
elif [[ $CIRCLE_TAG ]]; then
docker_tag="$DEST_NAME:$CIRCLE_TAG"
elif [[ $CIRCLE_BRANCH ]]; then
docker_tag="$DEST_NAME:$CIRCLE_BRANCH"
fi
echo "docker_tag: $docker_tag"
docker tag "$image_id" "$docker_tag"
docker push "$docker_tag"
if [[ $CIRCLE_TAG ]]; then
docker tag "$image_id" "$DEST_NAME:latest"
docker push "$DEST_NAME:latest"
fi
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git/
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM docker.io/hybsearch/docker-base:v1.1

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libgomp1 \
libargtable2-dev \
&& rm -rfv /var/lib/apt/lists/*

ADD . /clustal
WORKDIR /clustal

ARG cores=4

RUN ./configure --prefix=/usr/local --disable-dependency-tracking
RUN make -j$cores
RUN make -j$cores check
RUN make -j$cores install
RUN make -j$cores installcheck
RUN make -j$cores clean

0 comments on commit 4c90594

Please sign in to comment.