In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to install and use Docker under openSUSE. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
The detailed installation process of Docker in openSUSE environment, and try to run a simple Spring Boot image to feel the elegant demeanor of Docker.
What is Docker?
Docker is an open platform for developers and system administrators to build, publish, and run distributed applications. The platform consists of the Docker engine (a portable, lightweight runtime and packaging tool) and Docker Hub (a cloud service that shares applications and automated workflows). Docker enables applications to be quickly assembled from components and eliminates friction between development, quality assurance, and production environments. This allows the IT department to release faster, and these applications run on laptops, virtual machines in the data center, or any cloud, with the same process and results.
For more information about Docker, you can refer to the article "A brief introduction to Docker".
Precondition
64-bit system
Kernel 3.10 +
OpenSUSE 13.2 +. This example uses openSUSE Leap 42.1 (if you do not have an openSUSE system, you can try to install an openSUSE system in the virtual machine, see "Oracle VM VirtualBox installation and use" and "CentOS 7 installation, configuration")
Use uname-r to check the kernel version
$uname-r4.1.12-1-default
It is recommended that you use the latest system, thinking that the old bug will be fixed in the new kernel release.
Installation
Since openSUSE 13.2, it comes with its own warehouse, so there is no need to add
Install openSUSE domestic mirror source
For network reasons, the speed of accessing openSUSE is slow and unstable. It is recommended to use a domestic mirror library. The following example is the use of aliyun.
Zypper addrepo-f http://mirrors.aliyun.com/opensuse/update/leap/42.1/oss openSUSE-42.1-Update-Osszypper addrepo-f http://mirrors.aliyun.com/opensuse/update/leap/42.1/non-oss/ openSUSE-42.1-Update-Non-Osszypper addrepo-f http://mirrors.aliyun.com/opensuse/distribution/leap/42.1/repo/oss/ openSUSE-42.1-Osszypper addrepo-f http://mirrors.aliyun.com/opensuse / distribution/leap/42.1/repo/non-oss/ openSUSE-42.1-Non-Osszypper addrepo-f http://mirrors.aliyun.com/packman/openSUSE_Leap_42.1/ aliyun-packman install Docker package $sudo zypper in docker
The output is as follows:
Linux-aihn:~ # zypper in dockerRetrieving repository 'openSUSE-Leap-42.1-Update' metadata-- [|] Warning: Digest verification failed for file' 7256e9794decb02046412d2dc8ab5fa5a17875c1303f31663094da5ede29e933Mal appicons.tar.gz' [/ var/cache/zypp/raw/repo-updateQVITjj/repodata/7256e9794decb02046412d2dc8ab5fa5a17875c1303f31663094da5ede29e933-app-icons.tar.gz] expected 7256e9794decb02046412d2dc8ab5fa5a17875c1303f31663094da5ede29e933 but got a6be6f0868adbffa79d87856f6f3de4317a1e5c3f923be66eed899c4b559850bAccepting packages with wrong checksums can lead to a corrupted system and in extreme cases even to a system compromise .However if you made certain that the file with checksum 'a6be. Is secure, correctand should be used within this operation, enter the first 4 characters of the checksumto unblock using this file on your own risk. Empty input will discard the file.Unblock or discard? [a6be/? Shows all options] (discard): discardRetrieving repository 'openSUSE-Leap-42.1-Update' metadata. [error] Repository' openSUSE-Leap-42.1-Update' is invalid. [repo-update | http://download.opensuse.org/update/leap/42.1/oss/] Valid metadata not found at specified URLPlease check if the URIs defined for this repository are pointing to a valid repository.Skipping repository 'openSUSE-Leap-42.1- Update' because of the above error.Loading repository data...Reading installed packages...Resolving package dependencies...The following 6 NEW packages are going to be installed: bridge-utils docker git-core git-gui gitk perl-Error6 new packages to install.Overall download size: 10.6 MiB. Already cached: 0 B. After the operation, additional50.7 MiB will be used.Continue? [y/n/? Shows all options] (y): yRetrieving package perl-Error-0.17021-3.2.noarch (1 KiB unpacked 6), 28. 3 KiB (49. 8 KiB unpacked) Retrieving: perl-Error-0.17021-3.2.noarch.rpm. [done] Retrieving package bridge-utils-1.5-21.3.x86_64 (2 amp 6) 32. 0 KiB (66. 0 KiB unpacked) Retrieving: bridge-utils-1.5-21.3.x86_64.rpm. [done] Retrieving package git-core-2.6.2-3.1.x86_64 (3 + 6) 3.9 MiB (25.7 MiB unpacked) Retrieving: git-core-2.6.2-3.1.x86_64.rpm. [done (267.4 KiB/s)] Retrieving package gitk-2.6.2-3.1.x86_64 (4amp 6) 217.2 KiB (705.6 KiB unpacked) Retrieving: gitk-2.6.2-3.1.x86_64.rpm.... [done] Retrieving package git-gui-2.6.2-3.1.x86_64 (5 6) 296.1 KiB (1. 3 MiB unpacked) Retrieving: git-gui-2.6.2-3.1.x86_64.rpm. [done] Retrieving package docker-1.9.1-13.1.x86_64 (6 Unip 6) 6.2 MiB (22.9 MiB unpacked) Retrieving: docker-1.9.1-13.1.x86_64.rpm. [done (272.8 KiB/s)] Checking for file conflicts:. . [done] (1Compact 6) Installing: perl-Error-0.17021-3.2.. [done] (2Compact 6) Installing: bridge-utils-1.5-21.3.. . [done] (3Compact 6) Installing: git-core-2.6.2-3.1.[ done] (4Univer 6) Installing: gitk-2.6.2-3.1. .. [done] (5Compact 6) Installing: git-gui-2.6.2-3.1.[ done] (6Univer 6) Installing: docker-1.9.1-13. 1. [done] Additional rpm output:creating group docker...Updating / etc/sysconfig/docker... Start the docker daemon $sudo systemctl start docker.service configuration to let the docker service automatically start $sudo systemctl enable docker.service with the system
Docker creates a user group named docker and adds users to the user group
Sudo / usr/sbin/usermod-a-G docker Uninstall docker
Uninstall the Docker package:
$sudo zypper rm docker
The above command does not uninstall images, containers, volumes, or user-created configuration files on the host. To uninstall all of the above images, containers, volumes, execute:
$rm-rf / var/lib/docker
The profile created by the user on the host needs to be deleted manually.
Pull image to the local
You can pull the image stored in Docker Bub locally and execute
Docker pull waylau/docker-spring-boot
The output is as follows:
Linux-aihn:~ # docker pull waylau/docker-spring-bootUsing default tag: latestPulling repository docker.io/waylau/docker-spring-boot3694bcee2712: Download complete a2e9c1527ca5: Download complete 20f4b5a54fc6: Download complete 7a220626bc9e: Download complete 620bbe9b8954: Download complete a0b5e5298dc5: Download complete 2f8558117280: Download complete d2ee7992d027: Download complete Status: Downloaded newer image for waylau/docker-spring-boot:latestdocker.io/waylau/docker-spring-boot: this image was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker. Run the image local mirror
Execute:
Docker run-p 8080 8080-t waylau/docker-spring-boot
The final successful interface is as follows:
Linux-aihn:~ # docker run-p 8080 waylau/docker-spring-boot. _ _ / / _ _ _ (() _ _ _ |'_ _ _ | |\ / _ _ _ | | | (_ _ | |) )'| _ |. _ _ | _ | | _ | _ | | _\ _ _ | | / = | _ | = | _ _ / = / _ /:: Spring Boot:: (v1.3.3.RELEASE) 2016-03-31 102 INFO 53.043 INFO 1-[main] c.waylau.docker_spring_boot.Application: Starting Application v1.0.0 INFO 1 (/ app.jar started by root in /) 2016-03-31 0233 INFO 1- [main] c.waylau.docker_spring_boot.Application: No active profile set Falling back to default profiles: default2016-03-31 102 INFO 3315 INFO 1-[main] ationConfigEmbeddedWebApplicationContext: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@64dac4db: startup date [Thu Mar 31 02:33:54 GMT 2016] Root of context hierarchy2016-03-3102 o.s.b.f.s.DefaultListableBeanFactory 34 o.s.b.f.s.DefaultListableBeanFactory 03.254 INFO 1-[main] o.s.b.f.s.DefaultListableBeanFactory: Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName= (inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null] Scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName= (inferred) Defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]] 2016-03-31 102 INFO 34 INFO 1-[main] s.b.c.e.t.TomcatEmbeddedServletContainer: Tomcat initialized with port (s): 8080 (http) 2016-03-31 02 INFO 34 INFO 11.424 INFO 1-[main] o.apache.catalina.core.StandardService: Starting service Tomcat2016-03-31 02:34:11 .440 INFO 1-[main] org.apache.catalina.core.StandardEngine: Starting Servlet Engine: Apache Tomcat/8.0.322016-03-31 02 INFO 3474 INFO 1-[ost-startStop-1] o.a.c.c.C. [tomcat]. [localhost]. [/]: Initializing Spring embedded WebApplicationContext2016-03-3102 org.apache.catalina.core.StandardEngine 3412.575 INFO 1-[ost-startStop-1] o.s .web.context.ContextLoader: Root WebApplicationContext: initialization completed in 17670 ms2016-03-31 102 INFO 34 INFO 1-[ost-startStop-1] o.s.b.c.e.ServletRegistrationBean: Mapping servlet: 'dispatcherServlet' to [/] 2016-03-31 02 INFO 34 INFO 1-[ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean: Mapping filter:' characterEncodingFilter' to: [/ *] 2016-03-31 02 INFO 34 INFO 1-[ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean: Mapping filter: 'hiddenHttpMethodFilter' to: [/ *] 2016-03-31 02 INFO 34 INFO 1-[ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean: Mapping filter:' httpPutFormContentFilter' to: [/ *] 2016-03-31 02 24 INFO 1-[ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean: Mapping filter: 'requestContextFilter' to: [/ *] 2016-03-31 02MUR 34ma 20.432 INFO 1-[main] s.w.s.m.m.a.RequestMappingHandlerAdapter: Looking for @ ControllerAdvice: startup date [Thu Mar 31 02:33:54 GMT 2016] Root of context hierarchy2016-03-31 02 root of context hierarchy2016 34 s.w.s.m.m.a.RequestMappingHandlerMapping 21.405 INFO 1-[main] s.w.s.m.m.a.RequestMappingHandlerMapping: Mapped "{[/]}" onto public java.lang.String com.waylau.docker_spring_boot.Application.home () 2016-03-31 02 main 34 s.w.s.m.m.a.RequestMappingHandlerMapping 21.451 s.w.s.m.m.a.RequestMappingHandlerMapping: Mapped "{[/ error] Produces= [text/html]} "onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml (javax.servlet.http.HttpServletRequest Javax.servlet.http.HttpServletResponse) 2016-03-3102 javax.servlet.http.HttpServletResponse 34s.w.s.m.m.a.RequestMappingHandlerMapping 21.457 INFO 1-[main] s.w.s.m.m.a.RequestMappingHandlerMapping: Mapped "{[/ error]}" onto public org.springframework.http.ResponseEntity org.springframework.boot.autoconfigure.web.BasicErrorController.error (javax.servlet.http.HttpServletRequest) 2016-03-3102 INFO 1-[main] o.s.w. S.handler.SimpleUrlHandlerMapping: Mapped URL path [/ webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2016-03-31 02 INFO 3422. 037 INFO 1-[main] o.s.w.s.handler.SimpleUrlHandlerMapping: Mapped URL path [/ * *] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2016-03-31 02 INFO 34 22. 658 INFO 1-[ Main] o.s.w.s.handler.SimpleUrlHandlerMapping: Mapped URL path [/ * * / favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2016-03-31 102 onto handler of type 34 23.787 INFO 1-[main] o.s.j.e.a.AnnotationMBeanExporter: Registering beans for JMX exposure on startup2016-03-31 02 24 INFO 1-[ Main] s.b.c.e.t.TomcatEmbeddedServletContainer: Tomcat started on port (s): 8080 (http) 2016-03-31 02 http 3415 24.567 INFO 1-[main] c.waylau.docker_spring_boot.Application: Started Application in 39.766 seconds (JVM running for 46.766) access items
If the program runs correctly, the browser accesses http://localhost:8080/ and you can see the page "Hello Docker World." Words.
View docker image
You can see the situation, size and other information of the image returned by pull.
Linux-aihn:~ # docker imagesREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZEwaylau/docker-spring-boot latest 3694bcee2712 10 days ago 180.8 MB, after reading the above, do you have any further understanding of how to install and use Docker under openSUSE? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.