Skip to content
Snippets Groups Projects
Commit 43520607 authored by ale's avatar ale
Browse files

Add a Dockerfile

And use it to build images with the CI pipeline.
parent f8967d41
No related branches found
No related tags found
No related merge requests found
include: "https://git.autistici.org/ai3/build-deb/raw/master/ci-common.yml" image: docker:latest
stages:
- docker_build
- release
services:
- docker:dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
RELEASE_TAG: $CI_REGISTRY_IMAGE:latest
GIT_SUBMODULE_STRATEGY: recursive
docker_build:
stage: docker_build
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.autistici.org
- docker build --build-arg ci_token=$CI_JOB_TOKEN --pull -t $IMAGE_TAG .
- docker push $IMAGE_TAG
release:
stage: release
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.autistici.org
- docker pull $IMAGE_TAG
- docker tag $IMAGE_TAG $RELEASE_TAG
- docker push $RELEASE_TAG
only:
- master
FROM debian:buster AS build
RUN apt-get -q update && env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential libyara-dev pkg-config golang-go
ADD . /go/src/git.autistici.org/ai3/tools/yarascan
WORKDIR /go/src/git.autistici.org/ai3/tools/yarascan
RUN env GOPATH=/go go build -o /yarascan ./cmd/yarascan && strip /yarascan
FROM debian:buster
RUN apt-get -q update && env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libyara3
COPY --from=build /yarascan /usr/bin/yarascan
...@@ -19,6 +19,12 @@ $ go install git.autistici.org/ai3/tools/yarascan/cmd/yarascan ...@@ -19,6 +19,12 @@ $ go install git.autistici.org/ai3/tools/yarascan/cmd/yarascan
which will install the *yarascan* binary in *$GOPATH/bin*. which will install the *yarascan* binary in *$GOPATH/bin*.
## Packages
The *yarascan* tool can be packaged either as a Debian package (it
requires at least *buster* to build), or as a Docker image. This is
due to the libyara3 dependency.
# Usage # Usage
The *yarascan* utility supports a few different commands. The most The *yarascan* utility supports a few different commands. The most
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment