Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I am just getting started using Ansible and would like to try and run a playbook inside of a GitLab CI/CD job. However, I'm just finding out that the ansible/ansible image on the Docker Hub does not contain ansible-playbook. I'm getting cross-eyed looking at all of the unofficial ones out there, and I'm not sure what to pick. Can someone point me to an easy/readily-available Docker image I could pull that contains ansible-playbook just so that I can experiment? I'd prefer not to have to set up a whole separate Dockerfile etc. just to get started playing around.
Just build your own. Your Dockerfile could be as simple as:
FROM python:3.9
RUN pip install ansible
You say " I'd prefer not to have to set up a whole separate Dockerfile etc", but I don't think that adds much complexity. Update as necessary for Python or Ansible dependencies that are appropriate to your particular playbooks.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I have an ansible-playbook with 1000+ lines that builds my VM and I want to build a docker image with the same project-structure, dependencies, users, permissions etc.
so for example this code will be converted to "RUN pip3 install requests jsonschema ..."
- name: Install pip3 dependencies
pip:
executable: pip3
name:
- requests
- jsonschema
...
Not to convert into a Dockerfile bit to spit out a container image on the other side of the build pipeline, you could use ansible-bender.
At first it seems a bit odd to have a 1000+ lines ansible playbook. It should be more split up into roles, configurations and so forth, so you can better maintain and control your ansible playbook's target state.
Secondly, I doubt, that there's an automatism to solve your problem. What I can think of is something like running the playbook against your image or even, within your image and than "docker saving" it.
This could be the option to move faster towards your goal having a docker image with the same state your VM has, whenn you run ansible-playbook on it.
While you choose a simple docker base image to cover your ansible dependencies, you may extract specific playbook logic and put it into a RUN expression in your dockerfile, so, slicing the elephant your playbook seems to be into smaller portions that are covered by your ansible scripting.
I'd go for running ansible against a docker container, later saving the container state and releasing the image.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm new to Terraform and just did all the Tutorials i could find about it. I have set up Multiple Docker Containers and a Network, Currently starting it with a shell skript. The general plan would be, to be able to start my testbed and all its components with Terraform (Like ONOS with containernet, Routers, ...).
My First Question would, is Terraform made for that kind of Question? Or would you suggest anything different. I thought using Terraform would make it Easy to write new Scenarios.
AT this Point I use the Shell skripts to build and run the Docker Containers. Does it make sense to let Terraform do the RUN (not build) task?
Thanks for your Help & Opinions
I'm new to Stack, it would be awesome if you explain a downvote - so i can learn to do it better.
edit ( Build file deleted - unnecassary)
The general plan would be, to be able to start my testbed and all its components with Terraform
Tl;Dr
Don't do this.
This isn't what terraform is for. Terraform provisions infrastructure. So (as an example) if you want an azure function, you write a terraform file that describes what this looks like then run terraform to create it. It doesn't (nor should it) run your function. It simply describes how Azure should create these structures prior to them being ran.
It seems you actually want a build pipline that uses terraform as part of that process to provision the infrastructure. The build script would then run the containers once terraform had done it's job
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
when I use yaml file to deployment pods like this and use command kubectl apply -f xx.yaml
④image : nginx:latest
where does come from this Nginx image?
Is there any official Kubernetes documents about this?
Best Regards
Nginx is a webserver that is used as an example for a pod template here.
nginx:latest refers to the nginx image on the Docker hub.
The :latest part refers to which version of nginx to use, in this case it picks the latest version.
You can read more about Kubernetes templates and container here.
The general image name format is <registry>/<image-name>:<tag>.
Here, nginx:latest is in format of <image-name>:<tag> which refers registry is
dockerHub. If you want to pull image from any other registry you have to put it in <registry> section. To learn more about images click here.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
As it is shown in the readme of the official docker image, exists a prebuild image for LTS or weekly release. I can use it easily adding the FROM jenkins/jenkins directive in my docker file, as usual. In the documentation, is commented that you can also use the alpine based image.
If you see the github code, here we have several Dockerfile. One of them is the Dockerfile-alpine file. But I cannot find it in dockerhub
Does exists a prebuild image of Jenkins using alpine or do I need to download the code an compile myself? If exists, which tags are needed for using -as example- jenkins + lts + alpine?
jenkinsci/jenkins:alpine
or
jenkinsci/jenkins:lts-alpine
All official tag list=> https://hub.docker.com/r/jenkinsci/jenkins/tags/
On dockerhub the various images versions for a software, are separated by a tag that is used to label the different images.
On dockerhub, you can find the tags tabs which documents all the different flavors for an image.
In particular for jenkins you can find the jenkinsci/jenkins:alpine and jenkinsci/jenkins:lts-alpine images. Thus the images are already on dockerhub and you don't need to build them yourself.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I want to create a docker container which contains one or more containers.
Is it possible with Docker?
To run docker inside docker is definitely possible. The main thing is that you run the outer container with extra privileges (starting with --privileged=true) and then install docker in that container.
Check this blog post for more info: Docker-in-Docker.
One potential use case for this is described in this entry. The blog describes how to build docker containers within a Jenkins docker container.
However, Docker inside Docker it is not the recommended approach to solve this type of problems. Instead, the recommended approach is to create "sibling" containers as described in this post