Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install software using docker-compose

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to use docker-compose installation software", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use docker-compose installation software" bar!

Create the docker-compose base directory mkdir-p / usr/local/docker1 and install mysql

Create a mysql directory under the / usr/local/docker/ directory

Mkdir-p / usr/local/docker/mysql

Write the docker-compose.yml file in the / usr/local/docker/mysql directory

Note: the vi editor enters set paste in command mode, and then enter I to paste the content into the file in format.

Version: '3.1'services: db: image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: root command:-- default-authentication-plugin=mysql_native_password-- character-set-server=utf8mb4-- collation-server=utf8mb4_general_ci-- explicit_defaults_for_timestamp=true-- lower_case_table_names=1 ports:-3306 volumes: -. / data:/var/lib/mysql adminer: Image: adminer restart: always ports:-9999pur8080

Running container: docker-compose-f docker-compose.yml up-d

Destroy container docker-compose down

2 、 Install gitlabversion: '3.1'services: web: image:' twang2218/gitlab-ce-zh' restart: always hostname: '192.168.100.102' environment: TZ: 'Asia/Shanghai' GITLAB_OMNIBUS_CONFIG: | external_url' http://192.168.100.102' gitlab_rails ['gitlab_shell_ssh_port'] = 2222 unicorn [' port'] = 8888 nginx ['listen_port'] = 80 ports: -' 8000 ports 80'- '443 ports 443'-'2222 volumes: -. / config:/etc/gitlab -. / data:/var/opt/gitlab -. / logs:/var/log/gitlab

Access after startup: http://192.168.100.102

3. Install nexus3version: '3.1'services: nexus: restart: always image: sonatype/nexus3 container_name: nexus ports:-8081 nexus 8081 volumes:-nexus-data:/nexus-datavolumes: nexus-data:

Access after startup: http://192.168.100.102:8081

Maven uses nexus3

Configure the authentication information in setting.xml, and add the following configuration on the node:

Releases admin admin123 snapshots admin admin123

Add deployment configuration in pom.xml

Releases Nexus Release Repository http://192.168.100.101:8081/repository/maven-releases/ snapshots Nexus Snapshot Repository http://192.168.100.101:8081/repository/maven-snapshots/

Set up a proxy warehouse in pom.xml

Nexus Nexus Repository http://192.168.100.101:8081/repository/maven-public/ true true nexus Nexus Plugin Repository http://192.168.100.101:8081/repository/maven-public/ true true

Configure build information for pom.xml

Myshop org.springframework.boot spring-boot-maven-plugin org.apache.maven.plugins maven-deploy-plugin 2.8.2 true org.apache.maven.plugins maven-source-plugin 2.4 package jar org.apache.maven.plugins maven-resources-plugin 3.1. 0 UTF-8 org.apache.maven.plugins maven-compiler-plugin 3.8.1 1.8 1.8 UTF-8 Org.apache.maven.plugins maven-surefire-plugin 2.19 true

In nexus 3, there are no default users who can deploy maven private servers, only admin and anonymous users. In order for a role to deploy maven, you need to add all permissions of anonymous roles and the following permissions to it:

4. Install harbor

Download installation package: https://github.com/goharbor/harbor/releases

Upload to / usr/local/docker/ directory

4.3.decompress tar-zxvf harbor-offline-installer-v1.9.1-rc1.tgz

Go to the harbor directory and modify the harbor.yml file

Hostname: 192.168.100.102http: port: 8090harbor_admin_password: Harbor12345

4.5.Execute install.sh

Access after startup: http://192.168.100.101:8090 username: admin password: Harbor12345

4.6. Configure the client

# # create vim / etc/docker/daemon.json {"registry-mirrors": ["https://registry.docker-cn.com"]," insecure-registries ": [" 192.168.100.101 insecure-registries "]} Note: this file must conform to the JSON specification, otherwise docker will not be able to start

4.7. Restart the service

Systemctl daemon-reload systemctl restart docker

4.8. Check the configuration of private service

Docker info

4.9. Create an image and submit it to the harbor repository

# # pull nginxdocker pull nginx## to mark the image in the project # # docker tag SOURCE_IMAGE [: TAG] 192.168.100.101:8090/itchao-saas/IMAGE [: TAG] docker tag nginx:latest 192.168.100.101:8090/itchao-saas/nginx:latest## login docker login 192.168.100.101TAG 8090-u admin-p Harbor12345## push image to the current project # # docker push 192.168.100.101TAG 8090 / Itchao-saas/IMAGE [: TAG] docker push 192.168.100.101:8090/itchao-saas/nginx:latest5 、 Docker-compose setup Network

Create a network in advance

# # create a network docker network create # # View the existing network docker network list

Specify the network in docker-compose.yml

Networks: default: external: name: myapp6 、 Nginx installs version: '3.1'services: nginx: restart: always image: nginx ports:-8080 nginx 80-80:80-443 volumes: -. / conf.d:/etc/nginx/conf.d -. / log:/var/log/nginx -. / www:/var/www -. / etc/letsencrypt:/etc/letsencrypt thank you for reading These are the contents of "how to use docker-compose to install software". After the study of this article, I believe you have a deeper understanding of how to use docker-compose to install software, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report