Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dockerfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Picasoft
Technique
Dockerfiles
Commits
b2e62b4e
Verified
Commit
b2e62b4e
authored
5 years ago
by
Quentin Duchemin
Browse files
Options
Downloads
Patches
Plain Diff
Create a pica-ci base image built only once, should decrease overall build time
parent
39346f11
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+23
-2
23 additions, 2 deletions
.gitlab-ci.yml
pica-ci-base/Dockerfile
+14
-0
14 additions, 0 deletions
pica-ci-base/Dockerfile
pica-ci/Dockerfile
+3
-14
3 additions, 14 deletions
pica-ci/Dockerfile
with
40 additions
and
16 deletions
.gitlab-ci.yml
+
23
−
2
View file @
b2e62b4e
...
...
@@ -9,14 +9,35 @@ services:
-
docker:19.03.0-dind
stages
:
-
pica-ci-base
-
metabuild
-
build
-
static_tests
-
dynamic_tests
-
deployment
# build the container that further steps will run in in order to avoid duplicating instructions between steps
metabuild
:
# build the base image used for all further steps : this is done only when pica-ci's Dockerfile is modified
pica-ci-base
:
stage
:
pica-ci-base
before_script
:
-
echo $REGISTRY_PROD_PASSWORD | docker login $REGISTRY_PROD -u $REGISTRY_PROD_USERNAME --password-stdin
script
:
-
docker build -f pica-ci-base/Dockerfile . -t $REGISTRY_PROD/pica-ci-base:latest
-
docker push $REGISTRY_PROD/pica-ci-base:latest
after_script
:
-
docker logout $REGISTRY_PROD
tags
:
[
build
]
only
:
changes
:
-
"
pica-ci-base/*"
refs
:
-
master
-
dev-ci
-
tx-services-p19-test
-
dev-sympa
# create a image based on pica-ci with only a few environment variables added (which Dockerfile has been modified...)
metabuid
:
stage
:
metabuild
before_script
:
-
echo $REGISTRY_PASSWORD | docker login $REGISTRY -u $REGISTRY_USERNAME --password-stdin
...
...
This diff is collapsed.
Click to expand it.
pica-ci-base/Dockerfile
0 → 100644
+
14
−
0
View file @
b2e62b4e
FROM
docker:19.03.0
RUN
apk update
&&
\
apk add build-base
\
git
\
gnupg
\
iproute2
\
libffi-dev
\
openssl-dev
\
py-pip
\
python2-dev
\
sed
\
wget
&&
\
pip
install
docker-compose
This diff is collapsed.
Click to expand it.
pica-ci/Dockerfile
+
3
−
14
View file @
b2e62b4e
FROM
docker:19.03.0
FROM
registry.picasoft.net/pica-ci-base:latest
&
WORKDIR
/workdir
COPY
. /workdir/
RUN
apk update
&&
\
apk add build-base
\
git
\
gnupg
\
iproute2
\
libffi-dev
\
openssl-dev
\
py-pip
\
python2-dev
\
sed
\
wget
&&
\
pip
install
docker-compose
&&
\
chmod
+x get-modified-image.sh get-host-by-image.sh decrypt-secrets.sh
&&
\
RUN
chmod
+x get-modified-image.sh get-host-by-image.sh decrypt-secrets.sh
&&
\
export
MODIFIED_IMAGE_FULL
=
$(
./get-modified-image.sh
)
&&
\
export
MODIFIED_IMAGE
=
$(
echo
$MODIFIED_IMAGE_FULL
|
cut
-d
':'
-f1
)
&&
\
export
CONTAINER_NAME
=
$(
cat
$MODIFIED_IMAGE
/docker-compose.yml |
grep
$MODIFIED_IMAGE
-B1
|
head
-n1
|
cut
-d
':'
-f1
| xargs
)
&&
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment