mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-08 11:40:25 +00:00
gitlabci: Update Dockerfile and script
Re-heating a server template is a bad idea in the case of Docker images since they are composed of immutable layers. The size of the image will keep going up with each subsequent build. Building using debian:testing instead. GitLab is no longer allowing docker login with the main password. A personal access token with the permissions of "api, read_registry, write_registry" should be used instead. Avoided copying the massive .container directory into the Docker container by using a .dockerignore file. Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
50fb166f54
commit
a5c8c90eb0
@ -1,22 +1,28 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# This is an IaC pattern called "reheating a server template".
|
||||
# This is very fast but can accumulate cruft over time.
|
||||
# Use debian:testing if you want to build a fresh image.
|
||||
FROM registry.salsa.debian.org/freedombox-team/freedombox:gitlabci
|
||||
FROM debian:testing
|
||||
|
||||
USER root
|
||||
COPY . /plinth
|
||||
WORKDIR /plinth
|
||||
|
||||
RUN echo "deb http://deb.debian.org/debian testing main" > /etc/apt/sources.list
|
||||
RUN echo "deb-src http://deb.debian.org/debian testing main" >> /etc/apt/sources.list
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get build-dep -y . # Dependencies of the freedombox Debian package
|
||||
RUN apt-get install -y build-essential # Build dependencies
|
||||
RUN apt-get install -y sshpass parted # Test dependencies
|
||||
RUN apt-get install -y sudo
|
||||
RUN apt-get install -y $(./run --list-dependencies) # Module dependencies
|
||||
|
||||
# Dependencies of the freedombox Debian package
|
||||
RUN apt-get build-dep -y .
|
||||
|
||||
# Build dependencies
|
||||
RUN apt-get install -y build-essential \
|
||||
# Test dependencies
|
||||
sshpass parted \
|
||||
sudo python3-pip
|
||||
|
||||
# Module dependencies
|
||||
RUN apt-get install -y $(./run --list-dependencies)
|
||||
|
||||
# Coverage should know that test_functional.py files are tests
|
||||
RUN pip3 install splinter pytest-bdd
|
||||
|
||||
10
.ci/Dockerfile.gitlabci.dockerignore
Normal file
10
.ci/Dockerfile.gitlabci.dockerignore
Normal file
@ -0,0 +1,10 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
**/.git
|
||||
**/.container
|
||||
**/.vagrant
|
||||
**/.ci
|
||||
**/functional_tests
|
||||
**/doc
|
||||
**/build
|
||||
**/static
|
||||
@ -1,9 +1,8 @@
|
||||
#! /bin/bash
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Provide your Salsa credentials here
|
||||
docker login registry.salsa.debian.org
|
||||
|
||||
# This might need 20 minutes to run
|
||||
docker build -t registry.salsa.debian.org/freedombox-team/freedombox:gitlabci -f .ci/Dockerfile.gitlabci .
|
||||
# Build and upload a new image to the container registry
|
||||
DOCKER_BUILDKIT=1 docker build -t registry.salsa.debian.org/freedombox-team/freedombox:gitlabci -f .ci/Dockerfile.gitlabci .
|
||||
docker push registry.salsa.debian.org/freedombox-team/freedombox:gitlabci
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user