debuild & reprepro fixes

This commit is contained in:
Juan Ferrer 2020-01-16 15:09:47 +01:00
parent 3133106552
commit 2dab900fdc
6 changed files with 112 additions and 0 deletions

View File

@ -1,3 +1,30 @@
# Docker
Dockerfile and compose files used as basis for service deployment.
## Build and push an image
Move to desired folder
```
$ cd [folder]
```
Build the image.
```
$ docker build -t [registryUrl]/[imageName]:[tag] .
```
Login into docker registry.
```
$ docker login [registryUrl]
```
Push the image.
```
$ docker push [registryUrl]/[imageName]:[tag]
```
Logout from docker registry.
```
$ docker logout [registryUrl]
```

26
debuild/Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM debian:buster-slim
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y \
build-essential \
debhelper \
devscripts \
reprepro \
&& mkdir /build /reprepro
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ca-certificates \
gnupg2 \
libfontconfig \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y --no-install-recommends \
nodejs
VOLUME ["/build", "/reprepro"]
WORKDIR /build
COPY vn-debuild vn-include /usr/bin/

12
debuild/vn-debuild Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -e
srcDir=$1
if [ ! -f "$srcDir/debian/changelog" ]; then
echo "Invalid source directory."
exit 1
fi
echo "Building Debian packages."
(cd "$srcDir" && debuild -uc -us -b)

32
debuild/vn-include Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
set -e
srcDir=$1
if [ ! -f "$srcDir/debian/changelog" ]; then
echo "Invalid source directory."
exit 1
fi
codename=$2
buildDir="$srcDir/.."
if [ -z "$codename" ]; then
codename="stable"
fi
cut -d" " -f1 "$srcDir/debian/files" |
while read debFile; do
if [[ ! "$debFile" =~ .*\.deb$ ]]; then
continue
fi
echo "Adding $debFile"
reprepro -b "/reprepro" includedeb $codename "$buildDir/$debFile"
done
echo "Cleaning."
(cd "$srcDir" && debian/rules clean)
rm -f $buildDir/*.deb
rm -f $buildDir/*.changes
rm -f $buildDir/*.build

7
reprepro/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM php:7.4.1-apache
RUN apt-get update \
&& apt-get install -y --no-install-recommends reprepro \
&& rm -rf /var/lib/apt/lists/*
COPY apache.conf /etc/apache2/conf-enabled/reprepro.conf

8
reprepro/apache.conf Normal file
View File

@ -0,0 +1,8 @@
<Directory /var/www/html>
Options Indexes
Options +FollowSymLinks
AllowOverride None
Order Allow,Deny
Allow From All
Require all granted
</Directory>