Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Postgrest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dbis-public
Postgrest
Commits
1af13768
Commit
1af13768
authored
10 months ago
by
Alexander Hinneburg
Browse files
Options
Downloads
Patches
Plain Diff
Docker Wrapper
parent
6d6e47fe
No related branches found
No related tags found
No related merge requests found
Pipeline
#22069
passed
10 months ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+31
-0
31 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+17
-0
17 additions, 0 deletions
Dockerfile
with
48 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
31
−
0
View file @
1af13768
docker-build
:
# Use the official docker image.
image
:
docker:stable
stage
:
build
services
:
-
name
:
'
docker:dind'
alias
:
mydocker
command
:
[
'
--tls=false'
]
variables
:
DOCKER_IMAGE_NAME
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
DOCKER_HOST
:
tcp://mydocker:2375/
DOCKER_TLS_CERTDIR
:
"
"
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# All branches are tagged with $DOCKER_IMAGE_NAME (defaults to commit ref slug)
# Default branch is also tagged with `latest`
script
:
-
docker build -t "$DOCKER_IMAGE_NAME" .
# --pull -t "$DOCKER_IMAGE_NAME" .
-
docker push "$DOCKER_IMAGE_NAME"
-
|
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
docker tag "$DOCKER_IMAGE_NAME" "$CI_REGISTRY_IMAGE:latest"
docker push "$CI_REGISTRY_IMAGE:latest"
fi
# Run this job in a branch where a Dockerfile exists
rules
:
-
if
:
$CI_COMMIT_BRANCH
exists
:
-
Dockerfile
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
17
−
0
View file @
1af13768
# derive from any base image you want
FROM
alpine:latest
# copy PostgREST over
COPY
--from=postgrest/postgrest /bin/postgrest /bin
# add your other stuff
EXPOSE
3000
# This is the user id that Docker will run our image under by default. Note
# that we don't actually add the user to `/etc/passwd` or `/etc/shadow`. This
# means that tools like whoami would not work properly, but we don't include
# those in the image anyway. Not adding the user has the benefit that the image
# can be run under any user you specify.
USER
1000
CMD
[ "/bin/postgrest" ]
\ No newline at end of file
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