-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hybsearch/docker
Add Dockerfile and build on CircleCI
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.git/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |