The content has been moved to verdaccio core.
verdaccio / docker-examples Goto Github PK
View Code? Open in Web Editor NEW🐳 ⛴A collection of Docker and Kubernetes examples for verdaccio
Home Page: https://www.verdaccio.org/docs/en/docker.html
🐳 ⛴A collection of Docker and Kubernetes examples for verdaccio
Home Page: https://www.verdaccio.org/docs/en/docker.html
The content has been moved to verdaccio core.
the static files under -/static can not be found, if I change the location in verdaccio-conf
server {
listen 80 default_server;
access_log /var/log/nginx/verdaccio.log;
charset utf-8;
location /npm_dev/ {
proxy_pass http://verdaccio:4873/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_redirect off;
}
}
does I need additional configuration for the proxy? or is the location (-/static) of the static files in verdaccio a problem, especially the hyphen in the path?
same problem with apache-verdaccio example
Just that.
I added Verdaccio to the Kubernetes package manager:
This allow quick deployment of Verdaccio to any Kubernetes cluster via Helm:
$ helm install stable/verdaccio
Maybe worth to mention it somewhere?
I was looking into adding the logo there, can I use that one:
I'd great to have an example with LDAP as auth plugin
I'd be great to have
I am trying to setup Verdaccio on Docker container, where as I am able to launch Verdaccio with apache reverse proxy, but when I am trying to setup LDAP, where my container will interact with external active directory I am unable to do so,
could you please help me on how to setup Verdaccio which will interact with my company's directory server? and how to test this connection?
Describe the bug
permission denied
Error when using the docker example project
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/jsdom/node_modules/request/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/raw-body/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/request/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/send/node_modules/http-errors/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/send/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/@verdaccio
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/uglify-js/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/verdaccio-audit/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/verror/node_modules
npm WARN @verdaccio/[email protected] requires a peer of @types/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @verdaccio/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @verdaccio/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@>=2 but none is installed. You must install peer dependencies yourself.
npm ERR! path /opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams'
npm ERR! { [Error: EACCES: permission denied, access '/opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path:
npm ERR! '/opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /opt/verdaccio/.npm/_logs/2019-06-05T06_31_18_008Z-debug.log
To Reproduce
Steps to reproduce the behavior:
verdaccio/verdaccio:4
Hi everyone,
Two days I'm trying do something and run verdaccio on my raspberry pi 3. I'm newbe with docker but I'm still learning and have a question.
Why if vardaccio based on node:12.16.2-alpine
which is supporting linux/arm
does not support ARM processors? Are there exists some needed packages for linux which are not compatible installed using this command:
RUN apk --no-cache add openssl ca-certificates wget && \
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
apk add glibc-2.25-r0.apk
Or what is the reason of that? I don't want to waste more time for trying run in and needs your help and opinion if it is possible.
Starting verdaccio ... done
Attaching to verdaccio
verdaccio | fatal--- cannot open config file /verdaccio/conf/config.yaml: Error: CONFIG: it does not look like a valid config file
verdaccio exited with code 1
version: '3.1'
services:
verdaccio:
image: verdaccio/verdaccio
container_name: "verdaccio"
networks:
- node-network
environment:
- VERDACCIO_PORT=4873
ports:
- "4873:4873"
volumes:
- "./storage:/verdaccio/storage"
- "./config:/verdaccio/conf"
- "./plugins:/verdaccio/plugins"
networks:
node-network:
driver: bridge
volumes:
verdaccio:
driver: local
docker image inspect verdaccio/verdaccio
:
[
{
"Id": "sha256:b8a6d5a8cc292b0abadb0f44dd296e5ccb0354451ccd94588706215bd1051cca",
"RepoTags": [
"verdaccio/verdaccio:latest"
],
"RepoDigests": [
"verdaccio/verdaccio@sha256:a8afe4a6f5443b0400a409c218cdd46194d569a9abfe929ec885160d81bb1472"
],
"Parent": "",
"Comment": "",
"Created": "2019-10-23T19:17:28.852148734Z",
"Container": "f49a74e144d03a64e07037d508d62ea2c25cca7f11c8e305ab1c27e5af8b931e",
"ContainerConfig": {
"Hostname": "f49a74e144d0",
"Domainname": "",
"User": "10001",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"4873/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/opt/verdaccio/docker-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NODE_VERSION=10.16.3",
"YARN_VERSION=1.17.3",
"VERDACCIO_APPDIR=/opt/verdaccio",
"VERDACCIO_USER_NAME=verdaccio",
"VERDACCIO_USER_UID=10001",
"VERDACCIO_PORT=4873",
"VERDACCIO_PROTOCOL=http",
"HOME=/opt/verdaccio"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) ",
"CMD [\"/bin/sh\" \"-c\" \"$VERDACCIO_APPDIR/bin/verdaccio --config /verdaccio/conf/config.yaml --listen $VERDACCIO_PROTOCOL://0.0.0.0:$VERDACCIO_PORT\"]"
],
"ArgsEscaped": true,
"Image": "sha256:aac1d831fe9f6086788333fd19f190ac2f9aad6828418792ac5382c0663bf456",
"Volumes": {
"/verdaccio/storage": {}
},
"WorkingDir": "/opt/verdaccio",
"Entrypoint": [
"uid_entrypoint"
],
"OnBuild": null,
"Labels": {
"maintainer": "https://github.com/verdaccio/verdaccio"
}
},
"DockerVersion": "18.03.1-ee-3",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "10001",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"4873/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/opt/verdaccio/docker-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NODE_VERSION=10.16.3",
"YARN_VERSION=1.17.3",
"VERDACCIO_APPDIR=/opt/verdaccio",
"VERDACCIO_USER_NAME=verdaccio",
"VERDACCIO_USER_UID=10001",
"VERDACCIO_PORT=4873",
"VERDACCIO_PROTOCOL=http",
"HOME=/opt/verdaccio"
],
"Cmd": [
"/bin/sh",
"-c",
"$VERDACCIO_APPDIR/bin/verdaccio --config /verdaccio/conf/config.yaml --listen $VERDACCIO_PROTOCOL://0.0.0.0:$VERDACCIO_PORT"
],
"ArgsEscaped": true,
"Image": "sha256:aac1d831fe9f6086788333fd19f190ac2f9aad6828418792ac5382c0663bf456",
"Volumes": {
"/verdaccio/storage": {}
},
"WorkingDir": "/opt/verdaccio",
"Entrypoint": [
"uid_entrypoint"
],
"OnBuild": null,
"Labels": {
"maintainer": "https://github.com/verdaccio/verdaccio"
}
},
"Architecture": "amd64",
"Os": "linux",
"Size": 127860149,
"VirtualSize": 127860149,
"GraphDriver": {
"Data": {
"DeviceId": "14301",
"DeviceName": "docker-202:1-271892-d7890fc0c63f4418d9d4c0c03d31209fb559f14be43894d24aec33f37d3f6726",
"DeviceSize": "10737418240"
},
"Name": "devicemapper"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:f1b5933fe4b5f49bbe8258745cf396afe07e625bdab3168e364daf7c956b6b81",
"sha256:a3b85ad42b98d38a269880cc23d842bd267a630ab8554c032613ce6d9ba2476f",
"sha256:77306e58a4bd17b11d4151957d5ae677480e01e3a5db7797d1c53a7313c9c37e",
"sha256:dd108d5734de5775b9d4bdb550feb3133fd0ad6cbc18d5dbba65032a24cc5af2",
"sha256:d4e2c156f8f1c58807165bf4fc30de0b52bf83554c56bd25c55522d3f74b2d91",
"sha256:4e6bc2b3dc2b535fb47ef277fe800fed7a0bf9df0e41c56d7bdee9f552ad5c74",
"sha256:bc7b8c7c32806c56a4198d6c841b46d56578329578de6627bc6046b07492a69c",
"sha256:ea98a9b2a58c266b0934f53e7920f1f92c4e380e88e9b7c27ad7779b15300c98",
"sha256:c172f0cab7311de9c0775c55a37e00c06ed8c22dee38e812ff1c56590fb9a75d",
"sha256:262e1fbc5cbb85367669e9e89353c0b32c94b71abe6ee5c174147a0afb1a267f"
]
},
"Metadata": {
"LastTagTime": "0001-01-01T00:00:00Z"
}
}
]
I am running the reverse-proxy/nginx example with nginx ssl (https://github.com/verdaccio/docker-examples/tree/master/reverse_proxy/nginx/relative_path) in a development environment.
Publishing is working as expected, but I have a problem when I want to build a new docker image and use npm install within my Dockerfile.
Running the reverse-proxy/nginx example
docker-compose -f docker-compose_ssl.yml up --build --force-recreate
and
npm publish
Result: I can go to localhost and see my published package. I also can npm install it via the command line.
After that, that's my simple Dockerfile to build:
FROM node:13.3-alpine
WORKDIR /app
COPY package.json .
RUN npm install --only=prod --registry http://localhost
COPY . .
CMD ["npm", "start"]
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://localhost/@gitprodenv%2fcommon failed, reason: connect ECONNREFUSED 127.0.0.1:80
npm ERR! at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:219:5)
npm ERR! at Socket.socketErrorListener (_http_client.js:420:9)
npm ERR! at Socket.emit (events.js:219:5)
npm ERR! at emitErrorNT (internal/streams/destroy.js:84:8)
npm ERR! at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm ERR! FetchError: request to http://localhost/@gitprodenv%2fcommon failed, reason: connect ECONNREFUSED 127.0.0.1:80
npm ERR! at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:219:5)
npm ERR! at Socket.socketErrorListener (_http_client.js:420:9)
npm ERR! at Socket.emit (events.js:219:5)
npm ERR! at emitErrorNT (internal/streams/destroy.js:84:8)
npm ERR! at processTicksAndRejections (internal/process/task_queues.js:84:21) {
npm ERR! message: 'request to http://localhost/@gitprodenv%2fcommon failed, reason: connect ECONNREFUSED 127.0.0.1:80',
npm ERR! type: 'system',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! code: 'ECONNREFUSED',
npm ERR! stack: 'FetchError: request to http://localhost/@gitprodenv%2fcommon failed, reason: connect ECONNREFUSED 127.0.0.1:80\n' +
npm ERR! ' at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)\n' +
npm ERR! ' at ClientRequest.emit (events.js:219:5)\n' +
npm ERR! ' at Socket.socketErrorListener (_http_client.js:420:9)\n' +
npm ERR! ' at Socket.emit (events.js:219:5)\n' +
npm ERR! ' at emitErrorNT (internal/streams/destroy.js:84:8)\n' +
npm ERR! ' at processTicksAndRejections (internal/process/task_queues.js:84:21)',
npm ERR! parent: 'app'
npm ERR! }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'
I am already spending days because of that problem. I want to use verdaccio as a proxy for building new docker images. Thanks for your help.
Ths header can have two value,
proxy_set_header Host $host;
proxy_set_header Host $http_host;
which is the good one ?
Thanks
Hello,
I just bumped into a little snag trying to use Verdaccio in an environment where it is reverse-proxied with a url_prefix
. I thought I'd document what I found; hopefully this is helpful!
In the nginx reverse proxy example with a relative path, the Verdaccio instance at /verdaccio/
points to the static assets served by the instance at /
.
Because both of these instances are the same version, it conceals an underlying issue: that setting a url_prefix
in Verdaccio v4's config.yaml
doesn't lead to the url_prefix
being used for the accompanying static assets.
git clone https://github.com/verdaccio/docker-examples.git verdaccio-docker-examples
cd verdaccio-docker-examples/reverse_proxy/nginx/relative_path/
docker-compose build
docker-compose up
This starts Verdaccio instances at /
(v4), /verdaccio/
(v4), and /verdacciov3/
(v3). They all look and operate fine.
However, the source code in the /verdaccio/
instance refers to assets using URLs beginning with /
, rather than /verdaccio/
as specified in the url_prefix
:
<script type="text/javascript" src="/-/static/manifest.ba207bfcf72b6ad80f79.js"></script><script type="text/javascript" src="/-/static/vendors.ba207bfcf72b6ad80f79.js"></script><script type="text/javascript" src="/-/static/main.ba207bfcf72b6ad80f79.js"></script></body>
When I access /verdaccio/
, I see log entries from both the verdaccio_relative_path_v4
and verdaccio_relative_path_v4_root
containers.
If I then disable the verdaccio_relative_path_v4_root
container and refresh the browser, the /verdaccio/
page turns white, and the browser developer tools show these resources failed to load. The instance at /verdacciov3/
continues functioning unaffected.
In my use case, I need to confine Verdaccio completely to a subdirectory using url_prefix
, so serving the static assets from the the root of the domain is unfortunately not feasible.
See: #10
See: verdaccio/verdaccio#1299, verdaccio/verdaccio#1297
Many thanks,
Braxton
I followed the mentioned example and got the provisional header issue. There should be correct header directives in server block.
When I go to foobar:4873 this is the verdaccio web client - but not https. When I go to https://foobar:4871 I do get warned of a self-signed ssl, but then I get an nginx bad gateway error. http://foobar:4870 doens't work.
After updating my .npmrc
registry=https://foobar:4871/
strict-ssl=false
I tried doing an npm i -S @scope/example
(the package that comes w/ the example), still no success.
Thanks for anyone's direction with this, I haven't used https-portal before.
docker-compose.yml
version: '2'
services:
verdaccio:
image: verdaccio/verdaccio
container_name: verdaccio-https
ports:
- "4873:4873"
volumes:
- "./storage:/verdaccio/storage"
- "./conf:/verdaccio/conf"
https-portal:
image: steveltn/https-portal:1
container_name: verdaccio-portal
ports:
- '4870:80'
- '4871:443'
links:
- verdaccio:verdaccio
environment:
DOMAINS: 'foobar -> http://foobar:4873'
STAGE: local
kubernetes example says
➜ ~ kubectl logs verdaccio-deployment-64d64f5d95-z4nft -p
warn --- config file - /verdaccio/conf/config.yaml
warn --- Plugin successfully loaded: verdaccio-htpasswd
warn --- Plugin successfully loaded: verdaccio-audit
warn --- invalid address - http://0.0.0.0:tcp://10.111.233.6:4873, we expect a port (e.g. "4873"), host:port (e.g. "localhost:4873") or full url (e.g. "http://localhost:4873/")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.