feat: 增加 mariadb docker-registry nexus 应用

This commit is contained in:
zhengkunwang223 2023-02-27 18:58:42 +08:00
parent b61de24153
commit 7c4b3e9b89
13 changed files with 477 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -0,0 +1,73 @@
# Distribution
The toolset to pack, ship, store, and deliver content.
This repository's main product is the Open Source Registry implementation
for storing and distributing container images using the
[OCI Distribution Specification](https://github.com/opencontainers/distribution-spec).
The goal of this project is to provide a simple, secure, and scalable base
for building a large scale registry solution or running a simple private registry.
It is a core library for many registry operators including Docker Hub, GitHub Container Registry,
GitLab Container Registry and DigitalOcean Container Registry, as well as the CNCF Harbor
Project, and VMware Harbor Registry.
<img src="/distribution-logo.svg" width="200px" />
[![Build Status](https://github.com/distribution/distribution/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/distribution/distribution/actions?query=workflow%3ACI)
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/distribution/distribution)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
[![codecov](https://codecov.io/gh/distribution/distribution/branch/main/graph/badge.svg)](https://codecov.io/gh/distribution/distribution)
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Fdistribution.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Fdistribution?ref=badge_shield)
[![OCI Conformance](https://github.com/distribution/distribution/workflows/conformance/badge.svg)](https://github.com/distribution/distribution/actions?query=workflow%3Aconformance)
This repository contains the following components:
|**Component** |Description |
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **registry** | An implementation of the [OCI Distribution Specification](https://github.com/opencontainers/distribution-spec). |
| **libraries** | A rich set of libraries for interacting with distribution components. Please see [godoc](https://pkg.go.dev/github.com/distribution/distribution) for details. **Note**: The interfaces for these libraries are **unstable**. |
| **documentation** | Docker's full documentation set is available at [docs.docker.com](https://docs.docker.com). This repository [contains the subset](docs/) related just to the registry. |
### How does this integrate with Docker, containerd, and other OCI client?
Clients implement against the OCI specification and communicate with the
registry using HTTP. This project contains a client implementation which
is currently in use by Docker, however, it is deprecated for the
[implementation in containerd](https://github.com/containerd/containerd/tree/master/remotes/docker)
and will not support new features.
### What are the long term goals of the Distribution project?
The _Distribution_ project has the further long term goal of providing a
secure tool chain for distributing content. The specifications, APIs and tools
should be as useful with Docker as they are without.
Our goal is to design a professional grade and extensible content distribution
system that allow users to:
* Enjoy an efficient, secured and reliable way to store, manage, package and
exchange content
* Hack/roll their own on top of healthy open-source components
* Implement their own home made solution through good specs, and solid
extensions mechanism.
## Contribution
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute
issues, fixes, and patches to this project. If you are contributing code, see
the instructions for [building a development environment](BUILDING.md).
## Communication
For async communication and long running discussions please use issues and pull requests on the github repo.
This will be the best place to discuss design and implementation.
For sync communication we have a #distribution channel in the [CNCF Slack](https://slack.cncf.io/)
that everyone is welcome to join and chat about development.
## Licenses
The distribution codebase is released under the [Apache 2.0 license](LICENSE).
The README.md file, and files in the "docs" folder are licensed under the
Creative Commons Attribution 4.0 International License. You may obtain a
copy of the license, titled CC-BY-4.0, at http://creativecommons.org/licenses/by/4.0/.

View File

@ -0,0 +1,12 @@
{
"formFields": [
{
"type": "number",
"labelZh": "端口",
"labelEn": "Port",
"required": true,
"default": 5000,
"envKey": "PANEL_APP_PORT_HTTP"
}
]
}

View File

@ -0,0 +1,16 @@
version: '3'
services:
docker-registry:
image: registry:2.8.1
restart: always
container_name: ${CONTAINER_NAME}
ports:
- ${PANEL_APP_PORT_HTTP}:5000
networks:
- 1panel-network
volumes:
- ./data:/var/lib/registry
networks:
1panel-network:
external: true

View File

@ -3,11 +3,11 @@
"tags": [
{
"key": "WebSite",
"name": "站"
"name": "站"
},
{
"key": "Server",
"name": "服务器"
"name": "Web 服务器"
},
{
"key": "Database",
@ -222,6 +222,51 @@
"website": "https://www.mongodb.com/",
"github": "https://github.com/mongodb/mongo",
"document": "https://www.mongodb.com/docs/"
},
{
"key": "mariadb",
"name": "MariaDB",
"tags": ["Database"],
"versions": ["10.9.5"],
"shortDescZh": "MYSQL 复刻版",
"shortDescEn": "The open source relational database",
"type": "runtime",
"required": [],
"crossVersionUpdate": false,
"limit": 1,
"website": "https://mariadb.org/",
"github": "https://github.com/MariaDB/server/",
"document": "https://mariadb.org/documentation/"
},
{
"key": "docker-registry",
"name": "Docker Registry",
"tags": ["CI/CD"],
"versions": ["2.8.1"],
"shortDescZh": "Docker 镜像的存储和分发系统",
"shortDescEn": "A storage and distribution system for named Docker images",
"type": "runtime",
"required": [],
"crossVersionUpdate": false,
"limit": 1,
"website": "https://hub.docker.com/_/registry",
"github": "https://github.com/distribution/distribution",
"document": "https://docs.docker.com/registry/"
},
{
"key": "nexus",
"name": "Nexus Repository",
"tags": ["CI/CD"],
"versions": ["3.47.1"],
"shortDescZh": "开源存储库",
"shortDescEn": "An open source repository for build artifacts",
"type": "runtime",
"required": [],
"crossVersionUpdate": false,
"limit": 1,
"website": "https://www.sonatype.com/products/nexus-repository",
"github": "https://github.com/sonatype/docker-nexus3",
"document": "https://help.sonatype.com/repomanager3"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1,78 @@
Code status:
------------
* [![Appveyor CI status](https://ci.appveyor.com/api/projects/status/4u6pexmtpuf8jq66?svg=true)](https://ci.appveyor.com/project/rasmushoj/server) ci.appveyor.com
## MariaDB: The open source relational database
MariaDB was designed as a drop-in replacement of MySQL(R) with more
features, new storage engines, fewer bugs, and better performance.
MariaDB is brought to you by the MariaDB Foundation and the MariaDB Corporation.
Please read the CREDITS file for details about the MariaDB Foundation,
and who is developing MariaDB.
MariaDB is developed by many of the original developers of MySQL who
now work for the MariaDB Corporation, the MariaDB Foundation and by
many people in the community.
MySQL, which is the base of MariaDB, is a product and trademark of Oracle
Corporation, Inc. For a list of developers and other contributors,
see the Credits appendix. You can also run 'SHOW authors' to get a
list of active contributors.
A description of the MariaDB project and a manual can be found at:
https://mariadb.org
https://mariadb.com/kb/en/
https://mariadb.com/kb/en/mariadb-vs-mysql-features/
https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/
https://mariadb.com/kb/en/new-and-old-releases/
Help
-----
More help is available from the Maria Discuss mailing list
https://launchpad.net/~maria-discuss, MariaDB's Zulip
instance, https://mariadb.zulipchat.com/
Live QA for beginner contributors
----
MariaDB has a dedicated time each week when we answer new contributor questions live on Zulip.
From 8:00 to 10:00 UTC on Mondays, and 10:00 to 12:00 UTC on Thursdays,
anyone can ask any questions theyd like, and a live developer will be available to assist.
New contributors can ask questions any time, but we will provide immediate feedback during that interval.
Licensing
---------
***************************************************************************
NOTE:
MariaDB is specifically available only under version 2 of the GNU
General Public License (GPLv2). (I.e. Without the "any later version"
clause.) This is inherited from MySQL. Please see the README file in
the MySQL distribution for more information.
License information can be found in the COPYING file. Third party
license information can be found in the THIRDPARTY file.
***************************************************************************
Bug Reports
------------
Bug and/or error reports regarding MariaDB should be submitted at:
https://jira.mariadb.org
For reporting security vulnerabilities see:
https://mariadb.org/about/security-policy/
The code for MariaDB, including all revision history, can be found at:
https://github.com/MariaDB/server

View File

@ -0,0 +1,20 @@
{
"formFields": [
{
"type": "password",
"labelZh": "root用户密码",
"labelEn": "Root Password",
"required": true,
"default": "random",
"envKey": "PANEL_DB_ROOT_PASSWORD"
},
{
"type": "number",
"labelZh": "端口",
"labelEn": "Port",
"required": true,
"default": 3306,
"envKey": "PANEL_APP_PORT_HTTP"
}
]
}

View File

@ -0,0 +1,17 @@
version: '3'
services:
mariadb:
container_name: ${CONTAINER_NAME}
networks:
- 1panel-network
image: "mariadb:10.9.5"
ports:
- ${PANEL_APP_PORT_HTTP}:3306
volumes:
- ./db/data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${PANEL_DB_ROOT_PASSWORD}
networks:
1panel-network:
external: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,184 @@
<!--
Copyright (c) 2016-present Sonatype, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
# Sonatype Nexus3 Docker: sonatype/nexus3
[![Join the chat at https://gitter.im/sonatype/nexus-developers](https://badges.gitter.im/sonatype/nexus-developers.svg)](https://gitter.im/sonatype/nexus-developers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A Dockerfile for Sonatype Nexus Repository Manager 3, starting with 3.18 the image is based on the [Red Hat Universal Base Image](https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image) while earlier versions used CentOS.
* [Contribution Guidlines](#contribution-guidelines)
* [Running](#running)
* [Building the Nexus Repository Manager image](#building-the-nexus-repository-manager-image)
* [Chef Solo for Runtime and Application](#chef-solo-for-runtime-and-application)
* [Testing the Dockerfile](#testing-the-dockerfile)
* [Red Hat Certified Image](#red-hat-certified-image)
* [Notes](#notes)
* [Persistent Data](#persistent-data)
* [Getting Help](#getting-help)
## Contribution Guidelines
Go read [our contribution guidelines](https://github.com/sonatype/docker-nexus3/blob/main/.github/CONTRIBUTING.md) to get a bit more familiar with how
we would like things to flow.
## Running
To run, binding the exposed port 8081 to the host, use:
```
$ docker run -d -p 8081:8081 --name nexus sonatype/nexus3
```
When stopping, be sure to allow sufficient time for the databases to fully shut down.
```
docker stop --time=120 <CONTAINER_NAME>
```
To test:
```
$ curl http://localhost:8081/
```
## Building the Nexus Repository Manager image
To build a docker image from the [Dockerfile](https://github.com/sonatype/docker-nexus3/blob/main/Dockerfile) you can use this command:
```
$ docker build --rm=true --tag=sonatype/nexus3 .
```
The following optional variables can be used when building the image:
- NEXUS_VERSION: Version of the Nexus Repository Manager
- NEXUS_DOWNLOAD_URL: Download URL for Nexus Repository, alternative to using `NEXUS_VERSION` to download from Sonatype
- NEXUS_DOWNLOAD_SHA256_HASH: Sha256 checksum for the downloaded Nexus Repository Manager archive. Required if `NEXUS_VERSION`
or `NEXUS_DOWNLOAD_URL` is provided
## Chef Solo for Runtime and Application
Chef Solo is used to build out the runtime and application layers of the Docker image. The Chef cookbook being used is available
on GitHub at [sonatype/chef-nexus-repository-manager](https://github.com/sonatype/chef-nexus-repository-manager).
## Testing the Dockerfile
We are using `rspec` as the test framework. `serverspec` provides a docker backend (see the method `set` in the test code)
to run the tests inside the docker container, and abstracts away the difference between distributions in the tests
(e.g. yum, apt,...).
rspec [--backtrace] spec/Dockerfile_spec.rb
## Red Hat Certified Image
A Red Hat certified container image can be created using [Dockerfile.rh.ubi](https://github.com/sonatype/docker-nexus3/blob/main/Dockerfile.rh.ubi) which is built to be compliant with Red Hat certification.
The image includes additional meta data to comform with Kubernetes and OpenShift standards, a directory with the
licenses applicable to the software and a man file for help on how to use the software. It also uses an ENTRYPOINT
script the ensure the running user has access to the appropriate permissions for OpenShift 'restricted' SCC.
The Red Hat certified container image is available from the
[Red Hat Container Catalog](https://access.redhat.com/containers/#/registry.connect.redhat.com/sonatype/nexus-repository-manager)
and qualified accounts can pull it from registry.connect.redhat.com.
## Other Red Hat Images
In addition to the Universal Base Image, we can build images based on:
* Red Hat Enterprise Linux: [Dockerfile.rh.el](https://github.com/sonatype/docker-nexus3/blob/main/Dockerfile.rh.el)
* CentOS: [Dockerfile.rh.centos](https://github.com/sonatype/docker-nexus3/blob/main/Dockerfile.rh.centos)
## Notes
* Our [system requirements](https://help.sonatype.com/display/NXRM3/System+Requirements) should be taken into account when provisioning the Docker container.
* Default user is `admin` and the uniquely generated password can be found in the `admin.password` file inside the volume. See [Persistent Data](#user-content-persistent-data) for information about the volume.
* It can take some time (2-3 minutes) for the service to launch in a
new container. You can tail the log to determine once Nexus is ready:
```
$ docker logs -f nexus
```
* Installation of Nexus is to `/opt/sonatype/nexus`.
* A persistent directory, `/nexus-data`, is used for configuration,
logs, and storage. This directory needs to be writable by the Nexus
process, which runs as UID 200.
* There is an environment variable that is being used to pass JVM arguments to the startup script
* `INSTALL4J_ADD_VM_PARAMS`, passed to the Install4J startup script. Defaults to `-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs`.
This can be adjusted at runtime:
```
$ docker run -d -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=/some-other-dir" sonatype/nexus3
```
Of particular note, `-Djava.util.prefs.userRoot=/some-other-dir` can be set to a persistent path, which will maintain
the installed Nexus Repository License if the container is restarted.
Be sure to check the [memory requirements](https://help.sonatype.com/display/NXRM3/System+Requirements#SystemRequirements-MemoryRequirements) when deciding how much heap and direct memory to allocate.
* Another environment variable can be used to control the Nexus Context Path
* `NEXUS_CONTEXT`, defaults to /
This can be supplied at runtime:
```
$ docker run -d -p 8081:8081 --name nexus -e NEXUS_CONTEXT=nexus sonatype/nexus3
```
### Persistent Data
There are two general approaches to handling persistent storage requirements
with Docker. See [Managing Data in Containers](https://docs.docker.com/engine/tutorials/dockervolumes/)
for additional information.
1. *Use a docker volume*. Since docker volumes are persistent, a volume can be created specifically for
this purpose. This is the recommended approach.
```
$ docker volume create --name nexus-data
$ docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3
```
2. *Mount a host directory as the volume*. This is not portable, as it
relies on the directory existing with correct permissions on the host.
However it can be useful in certain situations where this volume needs
to be assigned to certain specific underlying storage.
```
$ mkdir /some/dir/nexus-data && chown -R 200 /some/dir/nexus-data
$ docker run -d -p 8081:8081 --name nexus -v /some/dir/nexus-data:/nexus-data sonatype/nexus3
```
## Getting Help
Looking to contribute to our Docker image but need some help? There's a few ways to get information or our attention:
* Chat with us on [Gitter](https://gitter.im/sonatype/nexus-developers)
* File an issue [on our public JIRA](https://issues.sonatype.org/projects/NEXUS/)
* Check out the [Nexus3](http://stackoverflow.com/questions/tagged/nexus3) tag on Stack Overflow
* Check out the [Nexus Repository User List](https://groups.google.com/a/glists.sonatype.com/forum/?hl=en#!forum/nexus-users)
## License Disclaimer
_Nexus Repository OSS is distributed with Sencha Ext JS pursuant to a FLOSS Exception agreed upon between Sonatype, Inc. and Sencha Inc. Sencha Ext JS is licensed under GPL v3 and cannot be redistributed as part of a closed source work._

View File

@ -0,0 +1,12 @@
{
"formFields": [
{
"type": "number",
"labelZh": "端口",
"labelEn": "Port",
"required": true,
"default": 8081,
"envKey": "PANEL_APP_PORT_HTTP"
}
]
}

View File

@ -0,0 +1,18 @@
version: '3'
services:
nexus:
image: sonatype/nexus3:3.47.1
restart: always
container_name: ${CONTAINER_NAME}
environment:
- TZ=Asia/Shanghai
ports:
- ${PANEL_APP_PORT_HTTP}:8081
volumes:
- ./data/nexus:/nexus-data
networks:
- 1panel-network
networks:
1panel-network:
external: true