Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab 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
nodes
rust
Dunitrust
Commits
7f1525a9
Commit
7f1525a9
authored
6 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[ci] add docker jobs to build durs image
parent
8d46c378
No related branches found
No related tags found
1 merge request
!139
Elois/docker
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+62
-0
62 additions, 0 deletions
.gitlab-ci.yml
release/docker/Dockerfile
+42
-0
42 additions, 0 deletions
release/docker/Dockerfile
with
104 additions
and
0 deletions
.gitlab-ci.yml
+
62
−
0
View file @
7f1525a9
...
...
@@ -202,6 +202,48 @@ package:test:linux64:
-
tags
when
:
manual
package:test:docker-test-image
:
<<
:
*ci_conditions
stage
:
package
image
:
docker:git
tags
:
-
docker
services
:
-
docker:dind
variables
:
LAST_COMMIT_HASH
:
$CI_COMMIT_SHORT_SHA
script
:
-
docker build -f release/docker/Dockerfile .
-
docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
-
docker build --pull -t "$CI_REGISTRY_IMAGE:test-image" -f release/docker/Dockerfile .
-
docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
-
docker push "$CI_REGISTRY_IMAGE:test-image"
except
:
-
tags
when
:
manual
package:test:docker
:
<<
:
*ci_conditions
stage
:
package
image
:
docker:git
tags
:
-
docker
services
:
-
docker:dind
variables
:
LAST_COMMIT_HASH
:
$CI_COMMIT_SHORT_SHA
script
:
-
docker build -f release/docker/Dockerfile .
-
docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
-
docker build --pull -t "$CI_REGISTRY_IMAGE:dev" -f release/docker/Dockerfile .
-
docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
-
docker push "$CI_REGISTRY_IMAGE:dev"
only
:
refs
:
-
dev
except
:
-
tags
package:test:armv7
:
<<
:
*rust_stable_armv7
stage
:
package
...
...
@@ -250,6 +292,26 @@ package:prod:linux64:
when
:
manual
allow_failure
:
false
package:prod:docker
:
<<
:
*ci_conditions
stage
:
package
image
:
docker:git
tags
:
-
docker
services
:
-
docker:dind
variables
:
LAST_COMMIT_HASH
:
$CI_COMMIT_SHORT_SHA
script
:
-
docker build -f release/docker/Dockerfile .
-
docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
-
docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" -f release/docker/Dockerfile .
-
docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
-
docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
only
:
-
tags
allow_failure
:
false
package:prod:armv7
:
<<
:
*rust_stable_armv7
stage
:
package
...
...
This diff is collapsed.
Click to expand it.
release/docker/Dockerfile
0 → 100644
+
42
−
0
View file @
7f1525a9
# ------------------------------------------------------------------------------
# Cargo Build Stage
# ------------------------------------------------------------------------------
FROM
registry.duniter.org/docker/duniter-rs-ci:v1.34.0
as
build
LABEL
maintainer="elois <elois@ifee.fr>"
LABEL
version="0.1.1"
LABEL
description="Durs server (Divende Universel RuSt)"
# copy source tree
COPY
./ ./
# build durs-server in release with features
RUN
cargo build
--release
--manifest-path
bin/durs-server/Cargo.toml
--features
ssl
# ------------------------------------------------------------------------------
# Final Stage
# ------------------------------------------------------------------------------
FROM
debian:jessie-slim
# install needed shared librairies
RUN
apt-get update
&&
\
apt-get
install
-y
ca-certificates libssl-dev
&&
\
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
RUN
useradd
-s
/bin/sh
-u
1000
-U
user
RUN
mkdir
-p
/home/user/.config /var/lib/durs
&&
chown
-R
user:user /home/user /var/lib/durs
# copy the build artifact from the build stage
COPY
--from=build --chown=user:user /target/release/durs /usr/bin/
VOLUME
/var/lib/durs
USER
user
WORKDIR
/home/user
CMD
["durs", "start"]
#run whith `docker run -it IMAGE`
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