Skip to content

Commit

Permalink
Merge pull request #26 from AxisCommunications/feature/automated_build2
Browse files Browse the repository at this point in the history
Add automated build hook
  • Loading branch information
johanxmodin committed Sep 22, 2021
2 parents 0773672 + faaa9df commit 799f94d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
dockerd
docker-proxy
dockerdwrapper
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.dockerd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ARG DOCKERVERSION=20.10.8

FROM docker:$DOCKERVERSION
ARG HTTP_PROXY
ARG HTTPS_PROXY

RUN mkdir /opt/dockerd
WORKDIR /opt/dockerd
Expand All @@ -8,7 +11,6 @@ WORKDIR /opt/dockerd
COPY Makefile.dockerd .
COPY DOCKERVERSION .
COPY 0001-Use-stretch-as-base-to-work-on-ARTPEC-6-7.patch .
COPY config.json /root/.docker/config.json

# Install the packages we use
RUN apk add --update \
Expand Down
11 changes: 8 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,24 @@ esac


dockerdtag=dockerd:1.0
imagetag=docker-acap:1.0
imagetag="${2:-docker-acap:1.0}"
dockerdname=dockerd_name

# First we build and copy out dockerd
docker build --build-arg ACAPARCH="$1" \
--build-arg STRIP=$strip \
--build-arg HTTP_PROXY \
--build-arg HTTPS_PROXY \
--tag $dockerdtag \
--no-cache \
--file Dockerfile.dockerd .

docker run -v /var/run/docker.sock:/var/run/docker.sock \
--env HTTP_PROXY="$HTTP_PROXY" \
--env HTTPS_PROXY="$HTTPS_PROXY" \
--name $dockerdname \
-it $dockerdtag

docker cp $dockerdname:/opt/dockerd/dockerd app/

docker stop $dockerdname
Expand All @@ -37,6 +42,6 @@ docker rm $dockerdname
docker build --build-arg ACAPARCH="$1" \
--file Dockerfile.acap \
--no-cache \
--tag $imagetag .
--tag "$imagetag" .

docker cp "$(docker create $imagetag)":/opt/app/ ./build
docker cp "$(docker create "$imagetag")":/opt/app/ ./build
9 changes: 0 additions & 9 deletions config.json

This file was deleted.

4 changes: 4 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# Extracts the architecture as the part of the image tag after '-'
AXIS_ARCH=$(echo $DOCKER_TAG | sed 's/.*-\(.*\)/\1/')
./build.sh $AXIS_ARCH $IMAGE_NAME

0 comments on commit 799f94d

Please sign in to comment.