2016-05-13 14:32:54 +02:00
# Yacy Docker image from latest sources
2016-06-03 14:50:03 +02:00
## Supported tags and respective Dockerfiles
2016-06-02 10:03:28 +02:00
* latest (Dockerfile)
2020-11-26 20:52:46 +01:00
* latest-alpine (Dockerfile.alpine)
2016-06-02 10:03:28 +02:00
2016-05-17 21:58:24 +02:00
## Getting built image from Docker Hub
2016-05-13 14:32:54 +02:00
2020-12-29 21:01:35 +01:00
The repository URL is https://hub.docker.com/r/yacy/yacy_search_server/
* ubuntu-based: `docker pull yacy/yacy_search_server:latest`
2016-05-13 14:32:54 +02:00
2016-05-17 21:58:24 +02:00
## Building image yourself
2016-05-13 14:32:54 +02:00
2020-12-29 21:01:35 +01:00
Using files in 'yacy_search_server/docker/':
```
cd yacy_search_server/docker
```
2016-05-13 14:32:54 +02:00
2020-12-29 21:01:35 +01:00
Then according to the image type:
2023-08-31 17:52:30 +02:00
* `yacy/yacy_search_server:latest` : This image is based on latest stable official Debian stable [openjdk ](https://hub.docker.com/_/openjdk/ ) 11 image provided by Docker. Embed Yacy compiled from latest git repository sources.
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
```
docker build -t yacy/yacy_search_server:latest -f Dockerfile ../
```
2016-06-02 10:03:28 +02:00
2020-12-31 00:02:23 +01:00
* `yacy/yacy_search_server:aarch64-latest` : same as yacy/yacy_search_server:latest but based on
2016-06-02 10:03:28 +02:00
2020-12-29 21:01:35 +01:00
```
2020-12-31 00:02:23 +01:00
docker build -t yacy/yacy_search_server:aarch64-latest -f Dockerfile.aarch64 ../
2020-12-29 21:01:35 +01:00
```
2016-06-02 10:03:28 +02:00
2016-05-13 14:32:54 +02:00
2020-12-29 21:01:35 +01:00
2016-05-17 21:58:24 +02:00
## Usage
2016-05-13 14:32:54 +02:00
2020-12-31 00:02:23 +01:00
### Run the docker image
2016-05-13 14:32:54 +02:00
2020-12-31 00:02:23 +01:00
```
docker run -d --name yacy -p 8090:8090 -p 8443:8443 -v yacy_data:/opt/yacy_search_server/DATA --log-opt max-size=200m --log-opt max-file=2 yacy/yacy_search_server:latest
```
2016-05-13 14:32:54 +02:00
2020-12-29 21:01:35 +01:00
YaCy web interface is then exposed at http://[container_ip]:8090
2016-05-13 14:32:54 +02:00
You can retrieve the container IP address with `docker inspect` .
2020-12-31 00:02:23 +01:00
#### Default admin account
2016-05-13 14:32:54 +02:00
2020-12-31 00:02:23 +01:00
* login: admin
* password: yacy
2016-05-13 14:32:54 +02:00
2020-12-31 00:02:23 +01:00
You should modify this default password with page /ConfigAccounts_p.html when exposing publicly your YaCy container.
2020-12-29 21:01:35 +01:00
2016-05-13 14:32:54 +02:00
2016-05-31 09:51:17 +02:00
#### Handle persistent data volume
2016-05-13 14:32:54 +02:00
2020-12-31 00:02:23 +01:00
As configured in the Dockerfile, by default yacy data (in /opt/yacy_search_server/DATA) will persist after container stop or deletion, in a volume named "yacy_data"
2016-05-13 14:32:54 +02:00
2020-12-29 21:01:35 +01:00
2016-08-05 11:57:38 +02:00
### HTTPS support
2016-08-05 12:16:11 +02:00
This images are default configured with HTTPS enabled, and use a default certificate stored in defaults/freeworldKeystore. You should use your own certificate. In order to do it, you can proceed as follow.
2016-08-05 11:57:38 +02:00
#### Self-signed certificate
2016-08-05 12:16:11 +02:00
A self-signed certificate will provide encrypted communications with your YaCy server, but browsers will still complain about an invalid security certificate with the error "SEC_ERROR_UNKNOWN_ISSUER". If it is sufficient for you, you can permanently add and exception to your browser.
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
This kind of certificate can be generated and added to your YaCy Docker container with the following:
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
keytool -keystore /var/lib/docker/volumes/[your_yacy_volume]/_data/SETTINGS/yacykeystore -genkey -keyalg RSA -alias yacycert
Then edit YaCy config file. For example with the nano text editor:
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
nano /var/lib/docker/volumes/[your_yacy_volume]/_data/SETTINGS/yacy.conf
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
And configure the keyStoreXXXX properties accordingly:
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
keyStore=/opt/yacy_search_server/DATA/SETTINGS/yacykeystore
keyStorePassword=yourpassword
2016-08-05 11:57:38 +02:00
#### Import an existing certificate:
2016-08-05 12:16:11 +02:00
Importing a certificate validated by a certification authority (CA) will ensure you have full HTTPS support with no security errors when accessing your YaCy peer. You can import an existing certificate in pkcs12 format.
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
First copy it to the YaCy Docker container volume:
cp [yourStore].pkcs12 /var/lib/docker/volumes/[your_yacy_volume]/_data/SETTINGS/[yourStore].pkcs12
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
Then edit YaCy config file. For example with the nano text editor:
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
nano /var/lib/docker/volumes/[your_yacy_volume]/_data/SETTINGS/yacy.conf
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
And configure the pkcs12XXX properties accordingly:
2016-08-05 11:57:38 +02:00
2020-12-29 21:01:35 +01:00
pkcs12ImportFile=/opt/yacy_search_server/DATA/SETTINGS/[yourStore].pkcs12
pkcs12ImportPwd=yourpassword
2016-05-13 14:32:54 +02:00
2016-05-17 21:58:24 +02:00
### Next starts
2016-05-13 14:32:54 +02:00
2016-05-17 21:58:24 +02:00
#### As attached process
2016-05-13 14:32:54 +02:00
2020-12-29 21:01:35 +01:00
docker start -a yacy
2016-05-17 21:59:29 +02:00
#### As background process
2016-05-13 14:32:54 +02:00
2020-12-29 21:01:35 +01:00
docker start yacy
2016-05-13 14:32:54 +02:00
2016-05-17 21:58:24 +02:00
### Shutdown
2016-05-13 14:32:54 +02:00
2016-05-17 21:58:24 +02:00
* Use "Shutdown" button in administration web interface
2020-12-29 21:01:35 +01:00
* OR run:
docker exec [your_container_name] /opt/yacy_search_server/stopYACY.sh
* OR run:
2016-05-30 09:14:23 +02:00
2020-12-29 21:01:35 +01:00
docker stop [your_container_name]
2016-12-31 09:51:07 +01:00
2016-07-03 17:28:47 +02:00
### Upgrade
You can upgrade your YaCy container the Docker way with the following commands sequence.
2020-12-29 21:01:35 +01:00
Get latest Docker image:
2016-07-03 17:28:47 +02:00
2020-12-29 21:01:35 +01:00
docker pull yacy/yacy_search_server:latest
Create new container based on pulled image, using volume data from old container:
docker create --name [tmp-container_name] -p 8090:8090 -p 8443:8443 --volumes-from=[container_name] --log-opt max-size=100m --log-opt max-file=2 yacy/yacy_search_server:latest
2016-07-03 17:28:47 +02:00
2020-12-29 21:01:35 +01:00
Stop old container:
2016-07-03 17:28:47 +02:00
2020-12-29 21:01:35 +01:00
docker exec [container_name] /opt/yacy_search_server/stopYACY.sh
2016-07-03 17:28:47 +02:00
2020-12-29 21:01:35 +01:00
Start new container:
2016-07-03 17:28:47 +02:00
2020-12-29 21:01:35 +01:00
docker start [tmp-container_name]
Check everything works fine, then you can delete old container:
docker rm [container_name]
Rename new container to reuse same container name:
docker rename [tmp-container_name] [container_name]
2016-06-02 10:03:28 +02:00
## License
2020-03-08 18:59:00 +01:00
View [license ](https://github.com/yacy/yacy_search_server/blob/master/COPYRIGHT ) information for the software contained in this image.