mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-17 07:45:52 +01:00
66b2175584
* New translations ansible.md (Chinese Traditional) * New translations uplinks.md (Chinese Traditional, Hong Kong) * New translations ssl.md (Urdu (Pakistan)) * New translations test.md (Chinese Traditional) * New translations test.md (Chinese Traditional, Hong Kong) * New translations test.md (Portuguese, Brazilian) * New translations test.md (Spanish) * New translations test.md (Urdu (Pakistan)) * New translations uplinks.md (Chinese Traditional) * New translations uplinks.md (Portuguese, Brazilian) * New translations ssl.md (Portuguese, Brazilian) * New translations uplinks.md (Spanish) * New translations uplinks.md (Urdu (Pakistan)) * New translations use-cases.md (Chinese Traditional) * New translations use-cases.md (Chinese Traditional, Hong Kong) * New translations use-cases.md (Portuguese, Brazilian) * New translations use-cases.md (Spanish) * New translations use-cases.md (Urdu (Pakistan)) * New translations ssl.md (Spanish) * New translations ssl.md (Chinese Traditional, Hong Kong) * New translations web.md (Chinese Traditional, Hong Kong) * New translations reverse-proxy.md (Chinese Traditional, Hong Kong) * New translations protect-your-dependencies.md (Urdu (Pakistan)) * New translations repositories.md (Chinese Traditional) * New translations repositories.md (Chinese Traditional, Hong Kong) * New translations repositories.md (Portuguese, Brazilian) * New translations repositories.md (Spanish) * New translations repositories.md (Urdu (Pakistan)) * New translations reverse-proxy.md (Chinese Traditional) * New translations reverse-proxy.md (Portuguese, Brazilian) * New translations ssl.md (Chinese Traditional) * New translations reverse-proxy.md (Spanish) * New translations reverse-proxy.md (Urdu (Pakistan)) * New translations server.md (Chinese Traditional) * New translations server.md (Chinese Traditional, Hong Kong) * New translations server.md (Portuguese, Brazilian) * New translations server.md (Spanish) * New translations server.md (Urdu (Pakistan)) * New translations web.md (Chinese Traditional) * New translations web.md (Portuguese, Brazilian) * New translations protect-your-dependencies.md (Portuguese, Brazilian) * New translations repositories.md (Chinese Simplified) * New translations install.md (Chinese Simplified) * New translations kubernetes.md (Chinese Simplified) * New translations logger.md (Chinese Simplified) * New translations notifications.md (Chinese Simplified) * New translations packages.md (Chinese Simplified) * New translations plugins.md (Chinese Simplified) * New translations protect-your-dependencies.md (Chinese Simplified) * New translations reverse-proxy.md (Chinese Simplified) * New translations home.md (Chinese Simplified) * New translations server.md (Chinese Simplified) * New translations ssl.md (Chinese Simplified) * New translations test.md (Chinese Simplified) * New translations uplinks.md (Chinese Simplified) * New translations use-cases.md (Chinese Simplified) * New translations web.md (Chinese Simplified) * New translations windows.md (Chinese Simplified) * New translations iis-server.md (Chinese Simplified) * New translations docker.md (Chinese Simplified) * New translations web.md (Spanish) * New translations web.md (Urdu (Pakistan)) * New translations windows.md (Chinese Traditional) * New translations windows.md (Chinese Traditional, Hong Kong) * New translations windows.md (Portuguese, Brazilian) * New translations windows.md (Spanish) * New translations windows.md (Urdu (Pakistan)) * New translations dev-plugins.md (Chinese Simplified) * New translations ansible.md (Chinese Simplified) * New translations auth.md (Chinese Simplified) * New translations cli.md (Chinese Simplified) * New translations config.md (Chinese Simplified) * New translations contributing.md (Chinese Simplified) * New translations protect-your-dependencies.md (Spanish) * New translations protect-your-dependencies.md (Chinese Traditional, Hong Kong) * New translations ansible.md (Chinese Traditional, Hong Kong) * New translations dev-plugins.md (Chinese Traditional) * New translations config.md (Spanish) * New translations config.md (Urdu (Pakistan)) * New translations contributing.md (Chinese Traditional) * New translations contributing.md (Chinese Traditional, Hong Kong) * New translations contributing.md (Portuguese, Brazilian) * New translations contributing.md (Spanish) * New translations contributing.md (Urdu (Pakistan)) * New translations dev-plugins.md (Chinese Traditional, Hong Kong) * New translations config.md (Chinese Traditional, Hong Kong) * New translations dev-plugins.md (Portuguese, Brazilian) * New translations dev-plugins.md (Spanish) * New translations dev-plugins.md (Urdu (Pakistan)) * New translations docker.md (Chinese Traditional) * New translations docker.md (Chinese Traditional, Hong Kong) * New translations docker.md (Portuguese, Brazilian) * New translations docker.md (Spanish) * New translations config.md (Portuguese, Brazilian) * New translations config.md (Chinese Traditional) * New translations home.md (Chinese Traditional) * New translations auth.md (Urdu (Pakistan)) * New translations ansible.md (Portuguese, Brazilian) * New translations ansible.md (Spanish) * New translations ansible.md (Urdu (Pakistan)) * New translations auth.md (Chinese Traditional) * New translations auth.md (Chinese Traditional, Hong Kong) * New translations auth.md (Portuguese, Brazilian) * New translations auth.md (Spanish) * New translations cli.md (Urdu (Pakistan)) * New translations cli.md (Chinese Traditional) * New translations cli.md (Chinese Traditional, Hong Kong) * New translations cli.md (Portuguese, Brazilian) * New translations cli.md (Spanish) * New translations docker.md (Urdu (Pakistan)) * New translations home.md (Chinese Traditional, Hong Kong) * New translations protect-your-dependencies.md (Chinese Traditional) * New translations packages.md (Chinese Traditional, Hong Kong) * New translations logger.md (Urdu (Pakistan)) * New translations notifications.md (Chinese Traditional) * New translations notifications.md (Chinese Traditional, Hong Kong) * New translations notifications.md (Portuguese, Brazilian) * New translations notifications.md (Spanish) * New translations notifications.md (Urdu (Pakistan)) * New translations packages.md (Chinese Traditional) * New translations packages.md (Portuguese, Brazilian) * New translations logger.md (Portuguese, Brazilian) * New translations packages.md (Spanish) * New translations packages.md (Urdu (Pakistan)) * New translations plugins.md (Chinese Traditional) * New translations plugins.md (Chinese Traditional, Hong Kong) * New translations plugins.md (Portuguese, Brazilian) * New translations plugins.md (Spanish) * New translations plugins.md (Urdu (Pakistan)) * New translations logger.md (Spanish) * New translations logger.md (Chinese Traditional, Hong Kong) * New translations home.md (Portuguese, Brazilian) * New translations install.md (Chinese Traditional) * New translations home.md (Spanish) * New translations home.md (Urdu (Pakistan)) * New translations iis-server.md (Chinese Traditional) * New translations iis-server.md (Chinese Traditional, Hong Kong) * New translations iis-server.md (Portuguese, Brazilian) * New translations iis-server.md (Spanish) * New translations iis-server.md (Urdu (Pakistan)) * New translations install.md (Chinese Traditional, Hong Kong) * New translations logger.md (Chinese Traditional) * New translations install.md (Portuguese, Brazilian) * New translations install.md (Spanish) * New translations install.md (Urdu (Pakistan)) * New translations kubernetes.md (Chinese Traditional) * New translations kubernetes.md (Chinese Traditional, Hong Kong) * New translations kubernetes.md (Portuguese, Brazilian) * New translations kubernetes.md (Spanish) * New translations kubernetes.md (Urdu (Pakistan))
142 lines
4.3 KiB
Markdown
142 lines
4.3 KiB
Markdown
---
|
|
id: docker
|
|
title: Docker
|
|
---
|
|
To pull the latest pre-built [docker image](https://hub.docker.com/r/verdaccio/verdaccio/):
|
|
|
|
`docker pull verdaccio/verdaccio`
|
|
|
|
## Tagged Versions
|
|
|
|
Since version `v2.x` you can pull docker images by [tag](https://hub.docker.com/r/verdaccio/verdaccio/tags/), as follows:
|
|
|
|
For a major version:
|
|
|
|
```bash
|
|
docker pull verdaccio/verdaccio:2
|
|
```
|
|
|
|
For a minor version:
|
|
|
|
```bash
|
|
docker pull verdaccio/verdaccio:2.1
|
|
```
|
|
|
|
For a specific (patch) version:
|
|
|
|
```bash
|
|
docker pull verdaccio/verdaccio:2.1.7
|
|
```
|
|
|
|
For the next major release using the `beta` version.
|
|
|
|
```bash
|
|
docker pull verdaccio/verdaccio:beta
|
|
```
|
|
|
|
The Canary version (master branch) is tagged as `next`
|
|
|
|
```bash
|
|
docker pull verdaccio/verdaccio:next
|
|
```
|
|
|
|
## Running verdaccio using Docker
|
|
|
|
To run the docker container:
|
|
|
|
```bash
|
|
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
|
|
```
|
|
|
|
The last argument defines which image to use. The above line will pull the latest prebuilt image from dockerhub, if you haven't done that already.
|
|
|
|
If you have [build an image locally](#build-your-own-docker-image) use `verdaccio` as the last argument.
|
|
|
|
You can use `-v` to mount `conf` and `storage` to the hosts filesystem:
|
|
|
|
```bash
|
|
V_PATH=/path/for/verdaccio; docker run -it --rm --name verdaccio -p 4873:4873 \
|
|
-v $V_PATH/conf:/verdaccio/conf \
|
|
-v $V_PATH/storage:/verdaccio/storage \
|
|
verdaccio/verdaccio
|
|
```
|
|
|
|
### Docker and custom port configuration
|
|
|
|
Any `host:port` configured in `conf/config.yaml` under `listen` is currently ignored when using docker.
|
|
|
|
If you want to reach verdaccio docker instance under different port, lets say `5000` in your `docker run` command replace `-p 4873:4873` with `-p 5000:4873`.
|
|
|
|
In case you need to specify which port to listen to **in the docker container**, since version 2.?.? you can do so by providing additional arguments to `docker run`: `--env PORT=5000` This changes which port the docker container exposes and the port verdaccio listens to.
|
|
|
|
Of course the numbers you give to `-p` paremeter need to match, so assuming you want them to all be the same this is what you could copy, paste and adopt:
|
|
|
|
```bash
|
|
PORT=5000; docker run -it --rm --name verdaccio \
|
|
--env PORT -p $PORT:$PORT
|
|
verdaccio/verdaccio
|
|
```
|
|
|
|
### Using HTTPS with Docker
|
|
|
|
You can configure the protocol verdaccio is going to listen on, similarly to the port configuration. You have to overwrite the default value("http") of the `PROTOCOL` environment variable to "https", after you specified the certificates in the config.yaml.
|
|
|
|
```bash
|
|
PROTOCOL=https; docker run -it --rm --name verdaccio \
|
|
--env PROTOCOL -p 4873:4873
|
|
verdaccio/verdaccio
|
|
```
|
|
|
|
### Using docker-compose
|
|
|
|
1. Get the latest version of [docker-compose](https://github.com/docker/compose).
|
|
2. Build and run the container:
|
|
|
|
```bash
|
|
$ docker-compose up --build
|
|
```
|
|
|
|
You can set the port to use (for both container and host) by prefixing the above command with `PORT=5000`.
|
|
|
|
Docker will generate a named volume in which to store persistent application data. You can use `docker inspect` or `docker volume inspect` to reveal the physical location of the volume and edit the configuration, such as:
|
|
|
|
$ docker volume inspect verdaccio_verdaccio
|
|
[
|
|
{
|
|
"Name": "verdaccio_verdaccio",
|
|
"Driver": "local",
|
|
"Mountpoint": "/var/lib/docker/volumes/verdaccio_verdaccio/_data",
|
|
"Labels": null,
|
|
"Scope": "local"
|
|
}
|
|
]
|
|
|
|
|
|
|
|
## Build your own Docker image
|
|
|
|
```bash
|
|
docker build -t verdaccio .
|
|
```
|
|
|
|
There is also an npm script for building the docker image, so you can also do:
|
|
|
|
```bash
|
|
npm run build:docker
|
|
```
|
|
|
|
Note: The first build takes some minutes to build because it needs to run `npm install`, and it will take that long again whenever you change any file that is not listed in `.dockerignore`.
|
|
|
|
If you want to use the docker image on a rpi or a compatible device there is also a dockerfile available. To build the docker image for raspberry pi execute:
|
|
|
|
```bash
|
|
npm run build:docker:rpi
|
|
```
|
|
|
|
Please note that for any of the above docker commands you need to have docker installed on your machine and the docker executable should be available on your `$PATH`.
|
|
|
|
## Docker Examples
|
|
|
|
There is a separate repository that hosts multiple configurations to compose Docker images with `verdaccio`, for instance, as reverse proxy:
|
|
|
|
https://github.com/verdaccio/docker-examples |