Coder Social home page Coder Social logo

docker-dev's Introduction

docker-dev's People

Contributors

hacdias avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-dev's Issues

Yarn failing in alpine (edge)

As commented in filebrowser/filebrowser#530 yarn is failing in golang:alpine with edge (the development tree). These are the differences between v3.8 and edge:

(1/17) Installing nghttp2-libs (1.33.0-r0)
(10/17) Installing libcrypto1.0 (1.0.2p-r0)
(13/17) Installing libssl1.0 (1.0.2p-r0)
(15/17) Installing libuv (1.22.0-r0)
(17/17) Installing yarn (1.9.4-r0)
(1/17) Installing nghttp2-libs (1.32.0-r0)
(10/17) Installing libcrypto1.0 (1.0.2o-r2)
(13/17) Installing libssl1.0 (1.0.2o-r2)
(15/17) Installing libuv (1.20.2-r0)
(17/17) Installing yarn (1.7.0-r0)

Moreover, yarn 1.9.4 works ok if installed manually on v3.8. So the source of the problem should be in any of the other.

Dockerfile and dependency?

Hi,
how I can make worked Dockerfile for build filebrowser?
Now I make this:

sudo mkdir -p /app/filebrowser && \
sudo touch /app/filebrowser/database.db && \
sudo bash -c 'cat <<EOT > /app/filebrowser/config.json
{
  "port": 80,
  "noAuth": false,
  "baseURL": "",
  "address": "",
  "database": "/etc/database.db",
  "plugin": "",
  "scope": "/FILES",
  "allowCommands": true,
  "allowEdit": true,
  "allowNew": true,
  "commands": []
}
EOT'

sudo mkdir -p /app/images/filebrowser && cd /app/images/filebrowser && \
sudo git clone https://github.com/filebrowser/filebrowser && \
sudo git clone https://github.com/filebrowser/frontend

sudo cp -rf /app/filebrowser/config.json /app/images/filebrowser/filebrowser/Docker.json && \
sudo mv /app/images/filebrowser/filebrowser/Dockerfile /app/images/filebrowser/Dockerfile && \
sudo bash -c 'cat /dev/null > /app/images/filebrowser/Dockerfile' && \
sudo nano /app/images/filebrowser/Dockerfile

Dockerfile

FROM golang:alpine

ARG DPURL=https://api.github.com/repos/golang/dep/releases/latest

RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories \
 && sed -i -e 's/v[0-9]\.[0-9]/edge/g' /etc/apk/repositories \
 && apk add -U --no-cache yarn git curl

COPY ./filebrowser /go/src/github.com/filebrowser/filebrowser
COPY ./frontend /go/src/github.com/filebrowser/frontend

WORKDIR /go/src/github.com/filebrowser/frontend
RUN yarn install; yarn build; exit 0

WORKDIR /go/src/github.com/filebrowser/filebrowser
RUN go get github.com/GeertJohan/go.rice/rice \
 && mkdir -p node_modules/filebrowser-frontend \
 && cp -rf /go/src/github.com/filebrowser/frontend/dist node_modules/filebrowser-frontend \
 && rice embed-go

RUN curl -fsSL "$(curl -s "${DPURL}" \
  | grep -i 'browser_download_url.*linux-amd64"' \
  | cut -d '"' -f 4)" -o /usr/local/bin/dep \
 && chmod +x /usr/local/bin/dep
RUN dep ensure -vendor-only

WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser
RUN CGO_ENABLED=0 go build -a
RUN mv filebrowser /go/bin/filebrowser

FROM scratch
COPY --from=0 /go/bin/filebrowser /filebrowser
COPY --from=0 /go/src/github.com/filebrowser/filebrowser/Docker.json /config.json

VOLUME /tmp
VOLUME /srv
EXPOSE 80

ENTRYPOINT ["/filebrowser", "--config", "/config.json"]

docker-composer

sudo bash -c 'cat <<EOT > /app/compose/filebrowser.yml
version: "3"
services:
 filebrowser:
  build: /app/images/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: "no"
EOT' && \
docker-compose -f /app/compose/filebrowser.yml config
docker-compose -p filebrowser -f /app/compose/filebrowser.yml up -d

Result:

Building filebrowser
Step 1/21 : FROM golang:alpine
 ---> 34d3217973fd
Step 2/21 : ARG DPURL=https://api.github.com/repos/golang/dep/releases/latest
 ---> Running in e55ba27c9bc1
Removing intermediate container e55ba27c9bc1
 ---> f0489380b34e
Step 3/21 : RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories  && sed -i -e 's/v[0-9]\.[0-9]/edge/g' /etc/apk/repositories  && apk add -U --no-cache yarn git curl
 ---> Running in 05b3076b35b4
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
(1/16) Installing nghttp2-libs (1.32.0-r0)
(2/16) Installing libssh2 (1.8.0-r3)
(3/16) Installing libcurl (7.61.0-r0)
(4/16) Installing curl (7.61.0-r0)
(5/16) Installing expat (2.2.5-r0)
(6/16) Installing pcre2 (10.31-r0)
(7/16) Installing git (2.18.0-r0)
(8/16) Installing c-ares (1.14.0-r0)
(9/16) Installing libcrypto1.0 (1.0.2p-r0)
(10/16) Installing libgcc (6.4.0-r8)
(11/16) Installing http-parser (2.8.1-r0)
(12/16) Installing libssl1.0 (1.0.2p-r0)
(13/16) Installing libstdc++ (6.4.0-r8)
(14/16) Installing libuv (1.22.0-r0)
(15/16) Installing nodejs (8.11.4-r0)
(16/16) Installing yarn (1.9.4-r0)
Executing busybox-1.28.4-r0.trigger
OK: 49 MiB in 30 packages
Removing intermediate container 05b3076b35b4
 ---> 43e411b60354
Step 4/21 : COPY ./filebrowser /go/src/github.com/filebrowser/filebrowser
 ---> 15c4945f35fd
Step 5/21 : COPY ./frontend /go/src/github.com/filebrowser/frontend
 ---> 3b3fca6ff5c7
Step 6/21 : WORKDIR /go/src/github.com/filebrowser/frontend
Removing intermediate container 67fdeed47770
 ---> 98c6d151668a
Step 7/21 : RUN yarn install; yarn build; exit 0
 ---> Running in 500ae0bae548
yarn install v1.9.4
info No lockfile found.
[1/4] Resolving packages...
-warning css-loader > cssnano > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
-warning css-loader > cssnano > postcss-merge-rules > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
-warning css-loader > cssnano > postcss-merge-rules > caniuse-api > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
-warning webpack-bundle-analyzer > [email protected]: Switch to the `bfj` package for fixes and new features!
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
-warning " > [email protected]" has incorrect peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 61.05s.
yarn run v1.9.4
$ node ./build/build.js
Total precache size is about 1.53 MB for 6 resources.
Hash: acc1abfb1d32a20944f6
Version: webpack 3.12.0
Time: 34164ms
                                              Asset       Size  Chunks                    Chunk Names
                       static/img/icons/favicon.ico    15.1 kB          [emitted]
              static/js/app.78abb6fa968cc91fdf0c.js     844 kB       0  [emitted]  [big]  app
static/css/app.91cd8ef5071f98059455a4174cb732ed.css     632 kB       0  [emitted]  [big]  app
          static/js/app.78abb6fa968cc91fdf0c.js.map    5.26 MB       0  [emitted]         app
     static/js/manifest.8642b1d6d76f4f56d3f7.js.map    9.27 kB       1  [emitted]         manifest
        static/img/icons/android-chrome-192x192.png    9.37 kB          [emitted]
        static/img/icons/android-chrome-512x512.png    23.1 kB          [emitted]
              static/img/icons/apple-touch-icon.png    7.42 kB          [emitted]
                 static/img/icons/browserconfig.xml  246 bytes          [emitted]
                 static/img/icons/favicon-16x16.png  843 bytes          [emitted]
                 static/img/icons/favicon-32x32.png    1.25 kB          [emitted]
         static/js/manifest.8642b1d6d76f4f56d3f7.js  871 bytes       1  [emitted]         manifest
                static/img/icons/mstile-144x144.png    7.21 kB          [emitted]
                static/img/icons/mstile-150x150.png    7.02 kB          [emitted]
                static/img/icons/mstile-310x150.png    7.64 kB          [emitted]
                static/img/icons/mstile-310x310.png    14.5 kB          [emitted]
                  static/img/icons/mstile-70x70.png       5 kB          [emitted]
             static/img/icons/safari-pinned-tab.svg    2.49 kB          [emitted]
                               static/manifest.json  480 bytes          [emitted]
                              static/share/404.html    1.83 kB          [emitted]
                            static/share/index.html       3 kB          [emitted]
                                         index.html    3.81 kB          [emitted]

  Build complete.

Done in 36.71s.
Removing intermediate container 500ae0bae548
 ---> 1d0c5a05616c
Step 8/21 : WORKDIR /go/src/github.com/filebrowser/filebrowser
Removing intermediate container 3a68b951b03e
 ---> 0adb426e7eed
Step 9/21 : RUN go get github.com/GeertJohan/go.rice/rice  && mkdir -p node_modules/filebrowser-frontend  && cp -rf /go/src/github.com/filebrowser/frontend/dist node_modules/filebrowser-frontend  && rice embed-go
 ---> Running in 15e9edc106d1
error reading package: no buildable Go source files in /go/src/github.com/filebrowser/filebrowser
ERROR: Service 'filebrowser' failed to build: The command '/bin/sh -c go get github.com/GeertJohan/go.rice/rice  && mkdir -p node_modules/filebrowser-frontend  && cp -rf /go/src/github.com/filebrowser/frontend/dist node_modules/filebrowser-frontend  && rice embed-go' returned a non-zero code: 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.