I know how to deploy custom KeyCloak theme in Windows using both ways as stated here:
Copy-paste theme in themes directory
Using archive deploy
Can someone please suggest how to do this in docker?
This is what I did:
Created Dockerfile like below
FROM jboss/keycloak
COPY ./themes/<yourThemeName>/ /opt/jboss/keycloak/themes/<yourThemeName>/
Built new docker image from this file
docker build -t <yourDockerHubUserName>/keycloak .
Run this docker image
docker container run --name <someContainerName> -p 8080:8080 -e
KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=password
<yourDockerHubUserName>/keycloak
Check if new theme shows up by logging into admin console at
http://localhost:8080/auth and go to realms/themes click drop down list of themes and you should see <yourThemeName>
Finally, did the following way. Copy the customized theme named MyTheme at some path say "/root/" from windows to the linux server using FileZilla or similar tools.
To list all the docker instances that are running on the server, use the following command:
docker ps
Find the container in which keycloak is running and pick its container id.
Now use the following command to copy the custom theme in the themes folder.:
docker cp /root/MyTheme/.
your_keycloak_container_id:/opt/jboss/keycloak/themes/MyTheme
Restart server.
Best way is by far to bundle the theme into a .jar file and drop it here: /opt/keycloak/providers.
Here you have a plugin that implement this approach.
You can also use keycloakify, it bundles the theme for you.
Related
I want to use the nextcloud image from dockerhub as the base image for the purpose of creating the a new child image having my own company's logo in place of nextcloud and my preferred background colour.Can anyone help me with the process or any link to the solution to this?
https://nextcloud.com/changelog
-download this zip
-make a docker file
-your should install apache and setup it
-change logo and colour theme in your css file
-built a new image
The general approach is this:
Run the official image locally, follow the instructions on Docker Hub to get started.
Modify the application using docker and shell commands. You can:
open a shell (docker exec -it <container> sh) in the running container and use console commands to edit files;
copy files from from the container and back with docker cp;
mount local files into the container by using -v <src>:<dest> in docker run command.
When you're done with editing, you need to repeat all the steps in a Dockerfile:
# use the version you used to start the local container
FROM nextcloud
# write commands that you used inside the container (if any)
RUN echo hello!
# Push edited files that you copied/mounted inside
COPY local.file /to/some/place/inside/the/image
# More possible commands in Dockerfile Reference
# https://docs.docker.com/engine/reference/builder/
After that you can use docker build to create your modified image.
I need to copy my customized keycloak themes into keycloak container to use it like mention here:
https://medium.com/#auscunningham/change-login-theme-in-keycloak-docker-image-55b5fa5ceec4
After identifying my container id: docker container ls and making a list of files like this: docker exec 7e3a420017a8 ls ./keycloak/themes
It returns the list of themes correctly, but using this to copy my files from local to container:
docker cp ./mycustomthem 7e3a420017a8:/keycloak/themes/
or
docker cp ./mycustomthem 7e3a420017a8:./keycloak/themes/
I get the following error:
Error: No such container:path: 7e3a420017a8:/keycloak
I cannot imagine where the error is, since I can list the files into the folder and container, could you help me?
Thank you in advance.
Works on my computer.
docker cp mycustomthem e67f76e8740b:/opt/jboss/keycloak/themes/raincatcher-theme
You have added the wrong path in command add full path /opt/jboss/keycloak/themes/raincatcher-theme.
This seems like a weird way to approach this problem. Why not just have a Dockerfile that uses the Keycloak container as the base image and then copies the theme into the container at build time? Then just run the image you build? This will also be a more stable pattern in the long term if you ever decide to add any plugins or customizations and it provides an easy upgrade path to new versions by just changing the base image in your Dockerfile.
Update according to your new question update:
Try the following:
docker cp ./mycustomthem 7e3a420017a8:/opt/jboss/keycloak/themes/
The correct path in Keycloak is actually /opt/jboss/keycloak/themes/
I found out that Progress has provided official docker images for their RDBMS.
I managed to pull the following image:
docker pull store/progresssoftware/oedb:12.2.3_adv-ent
I tried following the instructions to set it up, but they ask you to edit files inside the image?.
I'm not totally sure if they want me to only use the zip versions of the images or pull the images directly from the docker hub? Or is the idea to create my own Dockerfile where I use these as base images, and then set and create the required files and changes there? I couldn´t find anyone using these images in the web.
Could somebody provide me with example ´docker run´ command or ´Dockerfile´ to use these things?
beware that these images are for development and testing purposes only - they are not supported for production
The custom container images can then be used to bring up and dispose of database instances on demand for the purposes of incrementally building and testing OpenEdge applications
docker load vs docker run
You use docker load when you have docker image in archive format. Sometimes you do not want to push image to public places and you do not have private repository.
In this case you can do docker save. This command generates archive of your container. Then you can send this archive to private ftp.
To get this image you need:
Download image
Run docker load
When your image is uploaded to docker repository and you have rights to get it, you can use docker pull command. This is preferred command.
Unfortunately I have no idea how to run this enterprise tool, but they provide instruction here: https://docs.progress.com/bundle/openedge-database-docker-container/page/Run-an-OpenEdge-database-Docker-container-image.html
So example is:
docker run -d -p <database_server_port>:<database_server_port> -p <database_minport>-<database_maxport>:<database_minport>-<database_maxport> -e DB_BROKER_PORT=<database_server_port>
-e DB_MINPORT=<database_minport> -e DB_MAXPORT=<database_maxport> <custom_image_name>
you may use it as:
docker run -d -p 5432:5432 -p 5435-5440:5435-5440 -e DB_BROKER_PORT=5444
-e DB_MINPORT=5435 -e DB_MAXPORT=5440 store/progresssoftware/oedb:12.2.3_adv-ent
UPD: correct port forwarding syntax
I'm new to Docker and am learning how to implement Docker with Jenkins. I was able to succesfully bind a docker volume to my host machine directory with the following command
docker run –name jenkinsci -p 8080:8080 -p 50000:50000 -v ~/Jenkins:/var/jenkins_home/ jenkins/jenkins:lts
Now that the basic Jenkins is set up and binded to my host, there are a few things I wasn't sure to handle.
(1) This is only accessible through localhost:8080. How do I make this accessible to other computers? I've read that I can change the URL to my company's public IP address? Is this the right approach?
(2) I want to automate the installation of select plugins and setting the paths in the Global Tools Configuration. There were some tips on github https://github.com/jenkinsci/docker/blob/master/README.md but I wasn't clear on where this Dockerfile is placed. For example, if I wanted the plugins MSBuild and Green Balls to be installed, what would that look like?
FROM jenkins/jenkins:lts
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
Would I have to create a text file called plugins.txt where it contains a list of plugins I want downloaded? Where will this Dockerfile be stored?
(3) I also want a Dockerfile that installs all the dependencies to run my .NET Windows project (nuget, msbuild, wix, nunit, etc). I believe this Dockerfile will be placed in my git repository.
Basically, I'm getting overwhelmed with all this Docker information and am trying to piece together how Docker interacts with Jenkins. I would appreciate any advice and guidance on these problems.
Its ok to get overwhelmed by docker+kubernetes. Its a lot of information and whole overall shift how we have been handling applications/services.
To make jenkins available on all interfaces, use following command.
docker run –name jenkinsci -p "0.0.0.0:8080:8080" -p "0.0.0.0:50000:50000" -v ~/Jenkins:/var/jenkins_home/ jenkins/jenkins:lts
Yes, you have to provide the plugins.txt file, and create a new jenkins image containing all the required plugins. After that you can use this new image instead of jenkins/jenkins:lts.
The new image, suited for your workload should contain all the dependencies required for your environment.
I succesfully installed drupal 7 with docker.
Using docker4drupal, now my question when I start editing my drupal site is, where are the folders containing drupal?
Let's say I installed a new theme and want to swap the images for the banner, how do I access the drupal folder containing the images, or would it be preciser to ask : Where does Docker storage them?
My docker compose line is :
-codebase : /var/www/html
I know that installing it using :
./:/var/www/html
Would install drupal in the same directory my docker-compose.yml is, but for some reason it doesn't work and still doesn't show me where the files are.
Any help is welcome!
If you are not using volumes to mount your existing code, the code resides inside the docker container. You can access it only by getting inside the container using docker exec. If you are using the default docker-compose.yml that came with the repo, then the name of the container will be "docker4drupal_nginx_1" (since nginx is the default).
Run this code to get inside the container:
docker exec -it docker4drupal_nginx_1 /bin/bash
exec allows you to execute commands inside the container.
-it allows you to start an interactive terminal
/bin/bash allows you to start the bash terminal inside the container
Once you are inside container run ls and you will see drupal files including "web".
MORE USEFUL
However, this is not a useful way if you want to work on the files and probably use an editor. Instead, mount a directory on host machine. First make a new directory where your docker-compose.yml file is with the name "codebase".
Then, update the docker-compose.yml so that:
- codebase:/var/www/html
becomes
- ./codebase:/var/www/html
Do this in both php and nginx service definisions. Of course, you should do this after you run docker-compose down with your previous set up. Then restart containers using docker-compose up -d.
Then, you will notice that the Drupal files are present in the codebase directory.
If you see at the bottom of the yml file, you will see that "codebase" is defined as a Docker volume. This implies the storage is managed by Docker and it will get stored somewhere in /var/lib/docker/ along with the container itself.
Hope this helps.