Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matrix-media-repo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
TeDomum
matrix-media-repo
Commits
78d3ee4d
Commit
78d3ee4d
authored
6 years ago
by
Travis Ralston
Browse files
Options
Downloads
Plain Diff
Merge branch 'proposalDockerfile'
parents
8a2681b9
4bcab3c9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.dockerignore
+25
-0
25 additions, 0 deletions
.dockerignore
Dockerfile
+29
-20
29 additions, 20 deletions
Dockerfile
with
54 additions
and
20 deletions
.dockerignore
0 → 100644
+
25
−
0
View file @
78d3ee4d
/.idea
/bin
/pkg
/logs
media-repo*.yaml
homeserver.yaml
vendor/pkg
vendor/src
# Binaries for programs and plugins
*.exe
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
This diff is collapsed.
Click to expand it.
Dockerfile
+
29
−
20
View file @
78d3ee4d
FROM
docker.io/alpine
COPY
. /tmp/src
# ---- Stage 0 ----
# Builds media_repo and import_synapse
FROM
golang:1.11-alpine
AS
builder
# Install build dependencies
RUN
apk add
--no-cache
git musl-dev
\
&&
go get github.com/constabulary/gb/...
WORKDIR
/opt
COPY
./vendor /opt/vendor
COPY
./src /opt/src
RUN
GOPATH
=
`
pwd
`
/vendor gb vendor restore
RUN
GOPATH
=
`
pwd
`
:
`
pwd
`
/vendor go build
-v
-o
/opt/bin/media_repo ./src/github.com/turt2live/matrix-media-repo/cmd/media_repo/
\
&&
GOPATH
=
`
pwd
`
:
`
pwd
`
/vendor go build
-v
-o
/opt/bin/import_synapse ./src/github.com/turt2live/matrix-media-repo/cmd/import_synapse/
# ---- Stage 1 ----
# Final runtime stage.
FROM
alpine
RUN
apk add
--no-cache
\
su-exec
\
ca-certificates
\
&&
apk add
--no-cache
\
-t
build-deps
\
go
\
git
\
musl-dev
\
&&
cd
/tmp/src
\
&&
GOPATH
=
`
pwd
`
go get github.com/constabulary/gb/...
\
&&
PATH
=
$PATH
:
`
pwd
`
/bin gb vendor restore
\
&&
GOPATH
=
`
pwd
`
:
`
pwd
`
/vendor go build
-o
bin/media_repo ./src/github.com/turt2live/matrix-media-repo/cmd/media_repo/
\
&&
GOPATH
=
`
pwd
`
:
`
pwd
`
/vendor go build
-o
bin/import_synapse ./src/github.com/turt2live/matrix-media-repo/cmd/import_synapse/
\
&&
cp
bin/media_repo bin/import_synapse docker/run.sh /usr/local/bin
\
&&
cp
config.sample.yaml /etc/media-repo.yaml.sample
\
&&
cp
-R
migrations /var/lib/media-repo-migrations
\
&&
cd
/
\
&&
rm
-rf
/tmp/
*
\
&&
apk del build-deps
su-exec
\
ca-certificates
COPY
--from=builder /opt/bin/media_repo /opt/bin/import_synapse /usr/local/bin/
COPY
./config.sample.yaml /etc/media-repo.yaml.sample
COPY
./migrations /var/lib/media-repo-migrations
COPY
./docker/run.sh /usr/local/bin/
CMD
/usr/local/bin/run.sh
VOLUME
["/data", "/media"]
...
...
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