Open DeAlexPesh opened 6 years ago
The suggested approach is:
$ git clone --recurse-submodules https://github.com/filebrowser/filebrowser
$ cd filebrowser
$ USE_DOCKER="true" ./build/build_all.sh
# [Edit/replace Docker.json and/or Dockerfile, if you want]
$ docker build -t filebrowser/filebrowser .
The error no buildable Go source files....
is produced because you are executing rice embed-go
in the root of the repo. This changed after filebrowser/filebrowser#506 was merged. You now need to execute it inside subdir lib
.
See https://github.com/filebrowser/community/blob/master/development.md and https://github.com/filebrowser/community/blob/master/builds.md.
Thank you!
I make this, but no work:
sudo mkdir -p /app/images/filebrowser && cd /app/images/filebrowser && \
sudo git clone --recurse-submodules https://github.com/filebrowser/filebrowser
cd /app/images/filebrowser/filebrowser && \
sudo bash -c 'USE_DOCKER="true" ./build/build_all.sh'
sudo sed -i 's|ENTRYPOINT .*|ENTRYPOINT ["\/filebrowser", "--config", "\/config.json"]|' \
/app/images/filebrowser/filebrowser/Dockerfile
sudo bash -c 'cat <<EOT > /app/compose/filebrowser.yml
version: "3"
services:
filebrowser:
build: /app/images/filebrowser/filebrowser
image: images/filebrowser:scratch
container_name: "filebrowser"
ports:
- "9001:80"
volumes:
- "/:/FILES"
- "/app/filebrowser/config.json:/config.json"
- "/app/filebrowser/database.db:/etc/database.db"
environment:
USER_ID: 1000
GROUP_ID: 1000
network_mode: bridge
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "5"
restart: always
EOT' && \
docker-compose -f /app/compose/filebrowser.yml config
docker-compose -p filebrowser -f /app/compose/filebrowser.yml up -d
Output:
dos2unix: converting file build_assets.sh to Unix format...
dos2unix: converting file build.sh to Unix format...
yarn install v1.7.0
info No lockfile found.
[1/4] Resolving packages...
warning css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning eslint > file-entry-cache > flat-cache > circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
warning webpack-bundle-analyzer > bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is "1.12.3", while you're on "1.7.0".
info To upgrade, run the following command:
$ apk update && apk add -u yarn
Done in 71.84s.
yarn run v1.7.0
$ node ./build/build.js
⠴ building for production...Total precache size is about 1.51 MB for 6 resources.
Hash: e86192cfedcf58802de6
Version: webpack 3.12.0
Time: 57616ms
Asset Size Chunks Chunk Names
static/img/icons/mstile-144x144.png 7.21 kB [emitted]
static/js/app.caee61ffdf5642547fdc.js 823 kB 0 [emitted] [big] app
static/css/app.97bd0ed86d57796ebb51a8c42d40dee5.css 632 kB 0 [emitted] [big] app
static/js/app.caee61ffdf5642547fdc.js.map 5.15 MB 0 [emitted] app
static/js/manifest.123220cb93b9d190f6f3.js.map 9.27 kB 1 [emitted] manifest
static/img/icons/android-chrome-192x192.png 9.37 kB [emitted]
static/img/icons/favicon-16x16.png 843 bytes [emitted]
static/img/icons/favicon-32x32.png 1.25 kB [emitted]
static/img/icons/browserconfig.xml 246 bytes [emitted]
static/img/icons/android-chrome-512x512.png 23.1 kB [emitted]
static/img/icons/mstile-150x150.png 7.02 kB [emitted]
static/js/manifest.123220cb93b9d190f6f3.js 871 bytes 1 [emitted] manifest
static/img/icons/mstile-310x150.png 7.64 kB [emitted]
static/img/icons/mstile-310x310.png 14.5 kB [emitted]
static/img/icons/apple-touch-icon.png 7.42 kB [emitted]
static/img/icons/mstile-70x70.png 5 kB [emitted]
static/img/icons/safari-pinned-tab.svg 2.49 kB [emitted]
static/img/icons/favicon.ico 15.1 kB [emitted]
static/share/404.html 1.83 kB [emitted]
static/manifest.json 480 bytes [emitted]
static/share/index.html 3 kB [emitted]
index.html 3.81 kB [emitted]
Build complete.
Done in 62.91s.
github.com/asdine/storm (download)
Fetching https://go.etcd.io/bbolt?go-get=1
Parsing meta tags from https://go.etcd.io/bbolt?go-get=1 (status code 200)
get "go.etcd.io/bbolt": found meta tag get.metaImport{Prefix:"go.etcd.io/bbolt", VCS:"git", RepoRoot:"https://github.com/etcd-io/bbolt"} at https://go.etcd.io/bbolt?go-get=1
go.etcd.io/bbolt (download)
github.com/kardianos/osext (download)
github.com/gohugoio/hugo (download)
github.com/BurntSushi/toml (download)
github.com/chaseadamsio/goorgeous (download)
github.com/russross/blackfriday (download)
github.com/shurcooL/sanitized_anchor_name (download)
github.com/mattn/go-isatty (download)
github.com/PuerkitoBio/purell (download)
github.com/PuerkitoBio/urlesc (download)
Fetching https://golang.org/x/net/idna?go-get=1
Parsing meta tags from https://golang.org/x/net/idna?go-get=1 (status code 200)
get "golang.org/x/net/idna": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/idna?go-get=1
get "golang.org/x/net/idna": verifying non-authoritative meta tag
Fetching https://golang.org/x/net?go-get=1
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)
golang.org/x/net (download)
Fetching https://golang.org/x/text/secure/bidirule?go-get=1
Parsing meta tags from https://golang.org/x/text/secure/bidirule?go-get=1 (status code 200)
get "golang.org/x/text/secure/bidirule": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/secure/bidirule?go-get=1
get "golang.org/x/text/secure/bidirule": verifying non-authoritative meta tag
Fetching https://golang.org/x/text?go-get=1
Parsing meta tags from https://golang.org/x/text?go-get=1 (status code 200)
golang.org/x/text (download)
Fetching https://golang.org/x/text/transform?go-get=1
Parsing meta tags from https://golang.org/x/text/transform?go-get=1 (status code 200)
get "golang.org/x/text/transform": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/transform?go-get=1
get "golang.org/x/text/transform": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/unicode/bidi?go-get=1
Parsing meta tags from https://golang.org/x/text/unicode/bidi?go-get=1 (status code 200)
get "golang.org/x/text/unicode/bidi": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/unicode/bidi?go-get=1
get "golang.org/x/text/unicode/bidi": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/unicode/norm?go-get=1
Parsing meta tags from https://golang.org/x/text/unicode/norm?go-get=1 (status code 200)
get "golang.org/x/text/unicode/norm": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/unicode/norm?go-get=1
get "golang.org/x/text/unicode/norm": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/width?go-get=1
Parsing meta tags from https://golang.org/x/text/width?go-get=1 (status code 200)
get "golang.org/x/text/width": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/width?go-get=1
get "golang.org/x/text/width": verifying non-authoritative meta tag
github.com/alecthomas/chroma (download)
github.com/dlclark/regexp2 (download)
github.com/danwakefield/fnmatch (download)
github.com/spf13/cast (download)
github.com/spf13/viper (download)
github.com/fsnotify/fsnotify (download)
Fetching https://golang.org/x/sys/unix?go-get=1
Parsing meta tags from https://golang.org/x/sys/unix?go-get=1 (status code 200)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at https://golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
Fetching https://golang.org/x/sys?go-get=1
Parsing meta tags from https://golang.org/x/sys?go-get=1 (status code 200)
golang.org/x/sys (download)
github.com/hashicorp/hcl (download)
github.com/magiconair/properties (download)
github.com/mitchellh/mapstructure (download)
github.com/pelletier/go-toml (download)
github.com/spf13/afero (download)
github.com/spf13/jwalterweatherman (download)
github.com/spf13/pflag (download)
Fetching https://gopkg.in/yaml.v2?go-get=1
Parsing meta tags from https://gopkg.in/yaml.v2?go-get=1 (status code 200)
get "gopkg.in/yaml.v2": found meta tag get.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at https://gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
github.com/hashicorp/go-immutable-radix (download)
github.com/hashicorp/golang-lru (download)
github.com/pkg/errors (download)
github.com/jdkato/prose (download)
github.com/kyokomi/emoji (download)
github.com/miekg/mmark (download)
github.com/olekukonko/tablewriter (download)
github.com/mattn/go-runewidth (download)
github.com/hacdias/fileutils (download)
github.com/maruel/natural (download)
github.com/mholt/caddy (download)
github.com/robfig/cron (download)
Fetching https://golang.org/x/crypto/bcrypt?go-get=1
Parsing meta tags from https://golang.org/x/crypto/bcrypt?go-get=1 (status code 200)
get "golang.org/x/crypto/bcrypt": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/bcrypt?go-get=1
get "golang.org/x/crypto/bcrypt": verifying non-authoritative meta tag
Fetching https://golang.org/x/crypto?go-get=1
Parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200)
golang.org/x/crypto (download)
github.com/dgrijalva/jwt-go (download)
github.com/gorilla/websocket (download)
github.com/mholt/archiver (download)
github.com/dsnet/compress (download)
github.com/golang/snappy (download)
github.com/nwaples/rardecode (download)
github.com/pierrec/lz4 (download)
github.com/ulikunitz/xz (download)
github.com/xi2/xz (download)
github.com/hacdias/varutils (download)
github.com/mitchellh/go-homedir (download)
github.com/spf13/cobra (download)
Fetching https://gopkg.in/natefinch/lumberjack.v2?go-get=1
Parsing meta tags from https://gopkg.in/natefinch/lumberjack.v2?go-get=1 (status code 200)
get "gopkg.in/natefinch/lumberjack.v2": found meta tag get.metaImport{Prefix:"gopkg.in/natefinch/lumberjack.v2", VCS:"git", RepoRoot:"https://gopkg.in/natefinch/lumberjack.v2"} at https://gopkg.in/natefinch/lumberjack.v2?go-get=1
gopkg.in/natefinch/lumberjack.v2 (download)
github.com/asdine/storm/codec
go.etcd.io/bbolt
github.com/asdine/storm/codec/json
github.com/asdine/storm/q
github.com/asdine/storm/internal
github.com/asdine/storm/index
github.com/kardianos/osext
github.com/asdine/storm
github.com/GeertJohan/go.rice
github.com/BurntSushi/toml
github.com/russross/blackfriday
github.com/shurcooL/sanitized_anchor_name
github.com/chaseadamsio/goorgeous
github.com/mattn/go-isatty
github.com/gohugoio/hugo/common/terminal
github.com/gohugoio/hugo/common/text
github.com/PuerkitoBio/urlesc
golang.org/x/text/transform
golang.org/x/text/unicode/bidi
golang.org/x/text/unicode/norm
golang.org/x/text/secure/bidirule
golang.org/x/text/width
github.com/dlclark/regexp2/syntax
golang.org/x/net/idna
github.com/PuerkitoBio/purell
github.com/dlclark/regexp2
github.com/danwakefield/fnmatch
github.com/gohugoio/hugo/bufferpool
github.com/gohugoio/hugo/common/hugio
github.com/gohugoio/hugo/common/collections
github.com/gohugoio/hugo/common/math
github.com/alecthomas/chroma
github.com/spf13/cast
github.com/gohugoio/hugo/common/maps
github.com/alecthomas/chroma/formatters/html
github.com/alecthomas/chroma/lexers/internal
github.com/alecthomas/chroma/formatters
github.com/alecthomas/chroma/lexers/a
github.com/alecthomas/chroma/lexers/b
github.com/alecthomas/chroma/lexers/p
github.com/alecthomas/chroma/lexers/j
github.com/alecthomas/chroma/lexers/d
github.com/alecthomas/chroma/lexers/c
github.com/alecthomas/chroma/lexers/e
github.com/alecthomas/chroma/lexers/f
github.com/alecthomas/chroma/lexers/i
github.com/alecthomas/chroma/lexers/k
github.com/alecthomas/chroma/lexers/l
github.com/alecthomas/chroma/lexers/h
github.com/alecthomas/chroma/lexers/n
github.com/alecthomas/chroma/lexers/o
github.com/alecthomas/chroma/lexers/q
github.com/alecthomas/chroma/lexers/r
github.com/alecthomas/chroma/lexers/circular
github.com/alecthomas/chroma/lexers/g
github.com/alecthomas/chroma/lexers/m
github.com/alecthomas/chroma/lexers/s
github.com/alecthomas/chroma/lexers/t
github.com/alecthomas/chroma/lexers/v
github.com/alecthomas/chroma/lexers/w
github.com/alecthomas/chroma/lexers/x
github.com/alecthomas/chroma/lexers/y
github.com/alecthomas/chroma/styles
github.com/alecthomas/chroma/lexers
github.com/gohugoio/hugo/compare
golang.org/x/sys/unix
github.com/hashicorp/hcl/hcl/strconv
github.com/hashicorp/hcl/hcl/token
github.com/hashicorp/hcl/hcl/ast
github.com/hashicorp/hcl/hcl/scanner
github.com/hashicorp/hcl/hcl/parser
github.com/fsnotify/fsnotify
github.com/hashicorp/hcl/json/token
github.com/hashicorp/hcl/json/scanner
github.com/hashicorp/hcl/hcl/printer
github.com/hashicorp/hcl/json/parser
github.com/magiconair/properties
github.com/hashicorp/hcl
github.com/mitchellh/mapstructure
github.com/pelletier/go-toml
github.com/spf13/afero/mem
github.com/spf13/afero
github.com/spf13/jwalterweatherman
github.com/spf13/pflag
gopkg.in/yaml.v2
github.com/gohugoio/hugo/docshelper
github.com/hashicorp/golang-lru/simplelru
github.com/hashicorp/go-immutable-radix
github.com/pkg/errors
github.com/spf13/viper
github.com/jdkato/prose/internal/util
github.com/jdkato/prose/transform
github.com/kyokomi/emoji
github.com/gohugoio/hugo/config
github.com/miekg/mmark
github.com/gohugoio/hugo/hugofs
github.com/gohugoio/hugo/langs
github.com/gohugoio/hugo/hugolib/paths
github.com/gohugoio/hugo/hugolib/filesystems
github.com/mattn/go-runewidth
github.com/olekukonko/tablewriter
github.com/gohugoio/hugo/parser/pageparser
github.com/gohugoio/hugo/helpers
github.com/hacdias/fileutils
github.com/maruel/natural
github.com/mholt/caddy/vendor/github.com/flynn/go-shlex
github.com/mholt/caddy/vendor/github.com/google/uuid
github.com/mholt/caddy/telemetry
github.com/mholt/caddy/caddyfile
github.com/gohugoio/hugo/common/herrors
github.com/gohugoio/hugo/parser/metadecoders
github.com/mholt/caddy
github.com/gohugoio/hugo/parser
github.com/robfig/cron
golang.org/x/crypto/blowfish
github.com/dgrijalva/jwt-go
golang.org/x/crypto/bcrypt
github.com/filebrowser/filebrowser/lib
github.com/dgrijalva/jwt-go/request
github.com/gorilla/websocket
# github.com/filebrowser/filebrowser/lib
../lib/file.go:195:15: undefined: parser.ReadFrom
github.com/dsnet/compress/bzip2/internal/sais
github.com/dsnet/compress/internal
github.com/dsnet/compress/internal/errors
github.com/golang/snappy
github.com/dsnet/compress
github.com/dsnet/compress/internal/prefix
github.com/nwaples/rardecode
github.com/dsnet/compress/bzip2
github.com/pierrec/lz4/internal/xxh32
github.com/pierrec/lz4
github.com/ulikunitz/xz/internal/xlog
github.com/ulikunitz/xz/internal/hash
github.com/xi2/xz
github.com/ulikunitz/xz/lzma
github.com/hacdias/varutils
github.com/mitchellh/go-homedir
github.com/spf13/cobra
github.com/ulikunitz/xz
github.com/mholt/archiver
gopkg.in/natefinch/lumberjack.v2
filebrowser-tmp
Building filebrowser
Step 1/8 : FROM scratch
--->
Step 2/8 : COPY --from=filebrowser/dev /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
---> Using cache
---> b9f7fb328150
Step 3/8 : VOLUME /tmp
---> Using cache
---> 43c66f5f0866
Step 4/8 : VOLUME /srv
---> Using cache
---> f3c65dbcc46d
Step 5/8 : EXPOSE 80
---> Using cache
---> 5dfbffc74c67
Step 6/8 : COPY filebrowser /filebrowser
ERROR: Service 'filebrowser' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder221071234/filebrowser: no such file or directory
After the backend is built, the binary should be copied from subdir cli
to the root of the repo. See https://github.com/filebrowser/filebrowser/blob/master/build/build_all.sh#L44. Then, the container is removed. Please, check if the binary exists either in the root or in subdir cli
.
I use official
sudo mkdir -p /app/images/filebrowser && cd /app/images/filebrowser
sudo git clone --recurse-submodules https://github.com/filebrowser/filebrowser
cd /app/images/filebrowser/filebrowser
sudo bash -c 'USE_DOCKER="true" ./build/build_all.sh'
and official Dockerfile, but:
Building filebrowser
Step 1/8 : FROM scratch
--->
Step 2/8 : COPY --from=filebrowser/dev /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
---> 11689ab36c54
Step 3/8 : VOLUME /tmp
---> Running in ef0070feb839
Removing intermediate container ef0070feb839
---> cf5d1914e9bf
Step 4/8 : VOLUME /srv
---> Running in 0a32c740340a
Removing intermediate container 0a32c740340a
---> 681365cabb50
Step 5/8 : EXPOSE 80
---> Running in b8d1c0dada6f
Removing intermediate container b8d1c0dada6f
---> 015be8f4cc0b
Step 6/8 : COPY filebrowser /filebrowser
ERROR: Service 'filebrowser' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder280383416/filebrowser: no such file or directory
Hi, how I can make worked Dockerfile for build filebrowser? Now I make this:
Dockerfile
docker-composer
Result: