Artifactory oss install with Docker - docker

I'm trying to install Artifactory oss using docker.
I'm running ubuntu 18.04 and docker 19.03.8
I followed the JFrog installation guide https://www.jfrog.com/confluence/display/JFROG/Installing+Artifactory#InstallingArtifactory-DockerInstallation
I did all the steps. Except that chown -R 1030:1030 $JFROG_HOME/artifactory/var must be run with sudo.
The container start. But when I'm going to http://myhost:8082/ui/ I only see a page with the JFrog logo displaying with a zoomin/zoomout effect.
I the logs I see
################################################################
### All services started successfully in 116.053 seconds ###
################################################################
2020-03-26T07:27:05.070Z [jfrou] [INFO ] [ ] [server_configuration.go:61 ] [main] - Server configuration reloaded on localhost:8046
2020-03-26T07:27:05.070Z [jfrou] [INFO ] [ ] [server_configuration.go:61 ] [main ] - Server configuration reloaded on localhost:8049
2020-03-26T07:27:05.071Z [jfrou] [INFO ] [ ] [server_configuration.go:61 ] [main ] - Server configuration reloaded on :8082
2020-03-26T07:27:05.109Z [jfac ] [INFO ] [ ] [alConfigurationServiceBase:182] [c-default-executor-1] - Loading configuration from db finished successfully
2020-03-26T07:27:07.104Z [jfrou] [INFO ] [ ] [server_configuration.go:61 ] [main ] - Server configuration reloaded on :8082
2020-03-26T07:27:07.105Z [jfrou] [INFO ] [ ] [server_configuration.go:61 ] [main ] - Server configuration reloaded on localhost:8046
2020-03-26T07:27:07.105Z [jfrou] [INFO ] [ ] [server_configuration.go:61 ] [main ] - Server configuration reloaded on localhost:8049
2020-03-26T07:27:10.084Z [jfrou] [WARN ] [6ec6165e7fec2711] [ternal_topology_verifier.go:92] [main ] - failed pinging external node 'f461d2eebfe3' at address 'http://172.17.0.2:8082': Get http://172.17.0.2:8082/router/api/v1/system/ping: context deadline exceeded
The last line appears when I request the url in the browser.
What can I do ?
Edit:
I also tried with docker-compose also following the jfrog guide.
First run : artifactory is not starting !
After editing the .jfrog/artifactory/var/etc/system.yaml and chaning the 127.0.0.1 by my host name followed again with the config.sh artifactory is starting.
But same problem when accessing http://myhost:8082/ui/
I don't understand what's happening and why it is not working following the jfrog guides...

In my case, it turns out to be that my proxy settings are blocking the http client from contacting the local endpoint.
I updated docker-compose.yml to include no_proxy and noproxy environment variables and Artifactory runs without any complaint.
services:
artifactory:
environment:
- http_proxy=*********
- https_proxy=*********
- no_proxy=*********
- noproxy=172.16.0.0/12
image: docker.bintray.io/jfrog/artifactory-oss:latest

The solution was quite simple : try another browser !
With Edge it's not working.
With Firefox it's working ....

Related

Why starting Artifactory fails

I want to install artifactory on an ubuntu docker image manually without using the artifactory image from docker hub.
what I have done so far is :
Get an ubuntu image with JDK 11 installed.
I used apt-get I have installed the artifactory.
but when starting the artifactory service with service start artifactory I get the following logs with errors:
root#f01a31f43dc0:/# service artifactory start
2021-12-15T23:57:37.545Z [shell] [INFO ] [] [artifactory:81 ] [main] - Starting Artifactory tomcat as user artifactory...
2021-12-15T23:57:37.590Z [shell] [INFO ] [] [installerCommon.sh:1519 ] [main] - Checking open files and processes limits
2021-12-15T23:57:37.637Z [shell] [INFO ] [] [installerCommon.sh:1522 ] [main] - Current max open files is 1048576
2021-12-15T23:57:37.694Z [shell] [INFO ] [] [installerCommon.sh:1533 ] [main] - Current max open processes is unlimited
.shared.security value is of wrong data type. Correct type should be !!map
.shared.node value is of wrong data type. Correct type should be !!map
.shared.database value is of wrong data type. Correct type should be !!map
yaml validation failed
2021-12-15T23:57:37.798Z [shell] [WARN ] [] [installerCommon.sh:721 ] [main] - System.yaml validation failed
Database connection check failed Could not determine database type
2021-12-15T23:57:38.172Z [shell] [INFO ] [] [installerCommon.sh:3381 ] [main] - Setting JF_SHARED_NODE_ID to f01a31f43dc0
2021-12-15T23:57:38.424Z [shell] [INFO ] [] [installerCommon.sh:3381 ] [main] - Setting JF_SHARED_NODE_IP to 172.17.0.2
2021-12-15T23:57:38.652Z [shell] [INFO ] [] [installerCommon.sh:3381 ] [main] - Setting JF_SHARED_NODE_NAME to f01a31f43dc0
2021-12-15T23:57:39.348Z [shell] [INFO ] [] [artifactoryCommon.sh:186 ] [main] - Using Tomcat template to generate : /opt/jfrog/artifactory/app/artifactory/tomcat/conf/server.xml
2021-12-15T23:57:39.711Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${artifactory.port||8081} to default value : 8081
2021-12-15T23:57:39.959Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${artifactory.tomcat.connector.sendReasonPhrase||false} to default value : false
2021-12-15T23:57:40.244Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${artifactory.tomcat.connector.maxThreads||200} to default value : 200
2021-12-15T23:57:40.705Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${artifactory.tomcat.maintenanceConnector.port||8091} to default value : 8091
2021-12-15T23:57:40.997Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${artifactory.tomcat.maintenanceConnector.maxThreads||5} to default value : 5
2021-12-15T23:57:41.278Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${artifactory.tomcat.maintenanceConnector.acceptCount||5} to default value : 5
2021-12-15T23:57:41.751Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${access.http.port||8040} to default value : 8040
2021-12-15T23:57:42.041Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${access.tomcat.connector.sendReasonPhrase||false} to default value : false
2021-12-15T23:57:42.341Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${access.tomcat.connector.maxThreads||50} to default value : 50
2021-12-15T23:57:42.906Z [shell] [INFO ] [] [systemYamlHelper.sh:527 ] [main] - Resolved JF_PRODUCT_HOME (/opt/jfrog/artifactory) from environment variable
2021-12-15T23:57:43.320Z [shell] [INFO ] [] [artifactoryCommon.sh:1008 ] [main] - Resolved ${shared.tomcat.workDir||/opt/jfrog/artifactory/var/work/artifactory/tomcat} to default value : /opt/jfrog/artifact
ory/var/work/artifactory/tomcat
========================
JF Environment variables
========================
JF_SHARED_NODE_ID : f01a31f43dc0
JF_SHARED_NODE_IP : 172.17.0.2
JF_ARTIFACTORY_PID : /var/run/artifactory.pid
JF_SYSTEM_YAML : /opt/jfrog/artifactory/var/etc/system.yaml
JF_PRODUCT_HOME : /opt/jfrog/artifactory
JF_ROUTER_TOPOLOGY_LOCAL_REQUIREDSERVICETYPES : jfrt,jfac,jfmd,jffe,jfob
JF_SHARED_NODE_NAME : f01a31f43dc0
2021-12-15T23:57:45.827Z [shell] [ERROR] [] [installerCommon.sh:3267 ] [main] - ##############################################################################
2021-12-15T23:57:45.890Z [shell] [ERROR] [] [installerCommon.sh:3268 ] [main] - Ownership mismatch. You can try executing following instruction and do a restart
2021-12-15T23:57:45.959Z [shell] [ERROR] [] [installerCommon.sh:3269 ] [main] - Command : chown -R artifactory:artifactory /opt/jfrog/artifactory/var/log
2021-12-15T23:57:46.029Z [shell] [ERROR] [] [installerCommon.sh:3270 ] [main] - ##############################################################################
I'm not sure what I'm messing in this installation process.
The error is clear that there is permission issue on /opt/jfrog/artifactory/var/log folder and you should be running the chown -R artifactory:artifactory /opt/jfrog/artifactory/var/log command to solve it

how to add docker name parameter into kuberntes cluster

I am deploy the xxl-job application in Kubernetes(v1.15.2), now the application deploy success but registry client service failed.If deploy it in docker, it should look like this:
docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://mysql-service.example.com/xxl-job?Unicode=true&characterEncoding=UTF-8 --spring.datasource.username=root --spring.datasource.password=<mysql-password>" -p 8180:8080 -v /tmp:/data/applogs --name xxl-job-admin -d xuxueli/xxl-job-admin:2.0.2
and when start application,the server side give me tips:
22:33:21.078 logback [http-nio-8080-exec-7] WARN o.s.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/xxl-job-admin/api/registry] in DispatcherServlet with name 'dispatcherServlet'
I am searching from project issue and find the problem may be I could not pass the project name in docker to be part of it's url, so give me this tips.The client side give this error:
23:19:18.262 logback [xxl-job, executor ExecutorRegistryThread] INFO c.x.j.c.t.ExecutorRegistryThread - >>>>>>>>>>> xxl-job registry fail, registryParam:RegistryParam{registryGroup='EXECUTOR', registryKey='job-schedule-executor', registryValue='172.30.184.4:9997'}, registryResult:ReturnT [code=500, msg=xxl-rpc remoting fail, StatusCode(404) invalid. for url : http://xxl-job-service.dabai-fat.svc.cluster.local:8080/xxl-job-admin/api/registry, content=null]
so to solve the problem, I should execute command as possible as the same in kubernetes like execute with docker. The question is: How to pass the docker command --name to kubernetes environment? I have already tried this:
"env": [
{
"name": "name",
"value": "xxl-job-admin"
}
],
and also tried this:
"containers": [
{
"name": "xxl-job-admin",
"image": "xuxueli/xxl-job-admin:2.0.2",
}
]
Both did not work.

docker mount on windows, directory is empty

Running a simple docker test.
docker run --rm -v c:/Users:/data alpine ls -al /data
Results in the following output.
total 4
drwxr-xr-x 2 root root 40 Oct 19 09:02 .
drwxr-xr-x 1 root root 4096 Oct 19 09:05 ..
the directory is empty, in windows it contains the user(s).
edit
Further to this, looking at the docker log file, I see this:
[11:11:02.873][SambaShare ][Info ] Creating share "C:\" as "C" with Full Control to "QXV0615"
[11:11:02.957][Cmd ][Info ] C was shared successfully.
[11:11:03.005][Cmd ][Info ] Share name C
[11:11:03.005][Cmd ][Info ] Path C:\
[11:11:03.005][Cmd ][Info ] Remark
[11:11:03.005][Cmd ][Info ] Maximum users No limit
[11:11:03.005][Cmd ][Info ] Users
[11:11:03.005][Cmd ][Info ] Caching Caching disabled
[11:11:03.006][Cmd ][Info ] Permission W9\QXV0615, FULL
[11:11:03.006][Cmd ][Info ] The command completed successfully.
[11:11:03.009][SambaShare ][Info ] "C" is shared
[11:11:03.011][SambaShare ][Error ] Unable to validate cred: Invalid username or password
[11:11:03.011][SambaShare ][Info ] Removing share C
[11:11:03.053][NamedPipeClient][Info ] Received response for Mount
seems there is a samba credentials issue? How do I fix the credentials?
VPN ISSUE
The problem occurs when my CISCO VPN is connected.
Volumes will not work when the VPN is connected. I have tried the suggestions here, but no dice!
https://github.com/boot2docker/boot2docker/issues/628
https://github.com/docker/for-win/issues/360

Docker entrypoint doesn't find command

I am trying to run the znc docker container in docker-compose. I have tried to follow the docs, using --makeconf, but something's wrong with my config.
$ docker-compose up
Starting server_znc_service_1 ... done
Attaching to server_znc_service_1
znc_service_1 | /entrypoint.sh: exec: line 6: znc: not found
server_znc_service_1 exited with code 127
docker-compose.yml
version: '3.2'
services:
znc_service:
image: library/znc
volumes:
- znc-cfg-volume:/znc-data
ports:
- "6697:6697"
environment:
VIRTUAL_HOST: "znc.localhost"
command: ["znc", "--makeconf"]
volumes:
znc-cfg-volume:
First of all compose container with no-start:
docker-compose up --no-start
Then if you try to run it, you will see reasons:
$ docker run -it znc
[ .. ] Checking for list of available modules...
[ >> ] ok
[ .. ] Opening config [/znc-data/configs/znc.conf]...
[ !! ] No such file
[ ** ] Restart ZNC with the --makeconf option if you wish to create this config.
[ ** ] Unrecoverable config error.
Then just run with make conf:
docker run -it znc --makeconf
[ .. ] Checking for list of available modules...
[ >> ] ok
[ ** ]
[ ** ] -- Global settings --
[ ** ]
[ ?? ] Listen on port (1025 to 65534):

How to stop/start logstash service running in docker

I'm trying to figure out how logstash works/run inside docker, and I'm stuck with simple thing like starting and stoping logstash.
I have started logstash docker container with simple run
docker run -it --name l2 logstash
and with result:
[Api Webserver] INFO logstash.agent - Successfully started Logstash API endpoint {:port=>9600}
Next thing is runing /bin/bash with exec command, to get inside running container.
docker exec -it l2 /bin/bash
root#1b55d3a40d3f:/#
Listing services status, shows that there is no logstash service running.
Where can I find logstash service and stop/start?
root#1b55d3a40d3f:/# service --status-all
[ - ] bootlogs
[ - ] bootmisc.sh
[ - ] checkfs.sh
[ - ] checkroot-bootclean.sh
[ - ] checkroot.sh
[ - ] dbus
[ - ] hostname.sh
[ ? ] hwclock.sh
[ - ] killprocs
[ - ] motd
[ - ] mountall-bootclean.sh
[ - ] mountall.sh
[ - ] mountdevsubfs.sh
[ - ] mountkernfs.sh
[ - ] mountnfs-bootclean.sh
[ - ] mountnfs.sh
[ - ] procps
[ - ] rc.local
[ - ] rmnologin
[ - ] sendsigs
[ + ] udev
[ ? ] udev-finish
[ - ] umountfs
[ - ] umountnfs.sh
[ - ] umountroot
[ - ] urandom
[ - ] x11-common
The logstash in the container is not run as a system service, the entrypoint in the image will start a process and will keep the container up until this process ends or fails.
If you do a docker top l2 it will show the logstash process running (probaly alone) in the container.
To stop the logstash, you need to stop the container with docker stop l2, and later when you need to start it again you can run docker start l2, it will work as long you set the containers name as l2 when you create or first run it.
Docker Start help: https://docs.docker.com/engine/reference/commandline/start/
Docker stop help: https://docs.docker.com/engine/reference/commandline/stop/
Docker create: https://docs.docker.com/engine/reference/commandline/create/

Resources