Is there an official Docker image for Elastic Filebeat? - docker

Is there an official Docker image for Elastic Filebeat?
I see there are some community contributed ones, not sure if there is an official one.

Information about the official Docker images for Elastic Beats can be found at https://www.docker.elastic.co/#beats. The images are hosted in Elastic's container registry and not Docker Hub.
You can use the image with a command like:
docker run -v /var/log:/mnt/log docker.elastic.co/beats/filebeat:6.1.1
Or you can build your own image with customized config using a Dockerfile like:
FROM docker.elastic.co/beats/filebeat:6.1.1
COPY filebeat.yml /usr/share/filebeat/filebeat.yml
The images' source can be found at https://github.com/elastic/beats-docker.

Related

Scan docker images with Trivy from within a docker container

Problem
I would like to do the following:
Create an image with Trivy and Docker installed
Run the container on Kubernetes
Schedule a CRON job to pull all images from a container registry and to scan them, and output the results to stdout
Question
Is there a smart way to do this? Can you even install docker within a docker container?
I ended up doing the following:
Creating an image with Trivy and Skopeo installed
Downloading the docker images with Skopeo
skopeo copy --src-creds=user:password --dest-compress --src-tls-verify=false docker://myrepo.com/mynamespace/ubuntu:latest oci:ubuntu
Scanning the image
trivy image --input ubuntu
An alternative to Skopeo would be to use the Registry HTTP API to download images as suggested by David Maze.

Can Docker CLI, Podman and other similar tools have shared local storage for images?

I recently started using podman and realized that images pulled via docker doesn't become available for use to podman and vice-versa. For example:-
If I pull the image using docker CLI, as shown below
docker pull registry.access.redhat.com/ubi7-minimal
and If I want to use the same image with podman or buildah, turns out I cannot
[riprasad#localhost ~]$ podman inspect registry.access.redhat.com/ubi7-minimal
Error: error getting image "registry.access.redhat.com/ubi7-minimal": unable to find 'registry.access.redhat.com/ubi7-minimal' in local storage: no such image
I understand that this is because both podman and docker uses a different storage location and hence the image pulled down via docker doesn't becomes available for use with podman and vice-versa.
[riprasad#localhost ~]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.access.redhat.com/ubi7-minimal latest fc8736ea8c5b 5 weeks ago 81.5MB
[riprasad#localhost ~]$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
Is there a way to mitigate this issue, and somehow make docker and podman work inter-changeably on the very same image, irrespective of whether it has been pulled down via docker or podman ??
Docker and Podman do not sure the same storage. They can not, because Docker controls locking to its storage within the daemon. While Podman, Buildah, CRI-O, Skopeo all can share content, because they use the file system.
Podman and the other tools can work with the docker-daemon storage indirectly, via the "docker-daemon" transport.
Something like:
podman run docker-daemon:alpine echo hello
Should work.
Note, that podman is pulling the image out of the docker daemon and is storing the image in containers/storage, and then running the container, it is not using the Docker storage directly.
You can also do
podman push myimage docker-daemon:myimage
To copy an image from containers/storage into the docker daemon.
Adding to #rhatdan's post
podman run docker://alpine echo hello
This worked for me.
For more details: Here->

find base image or ''source in docker hub'' for an image in local

The project I am working have its docker images built from
FROM java:8-jre
Now I am writing a new service and though I can also make java:8-jre base image for my service. But I wanted to find out from where it was taken at the first place. As on docker hub I see only openjdk or oracle one is available.
Also if I do like below it is downloaded from docker hub (I guess, As I tried on my local as well), But cant see it on dockerHub(why?)
docker pull java:8-jre
Is there any way, I can search this image at docker hub or find its source with something like below -
docker image inspect java:8-jre
This image belongs to the official java repository, which is deprecated in favor of openjdk repository.
Accessing this repo will redirect you to the openjdk page.
But you can have a glimpse of java repo page here.
You can still find the Dockerfile for your image here.
Information which you need will be available in Dockerfile for that particular image.
I didn't find any image with name java:8-jre in docker hub.
Closest which I found was
https://hub.docker.com/r/fiadliel/java8-jre/
To see steps of Dockerfile for that Image build try this
docker image history --no-trunc image_name > image_history

Cannot connect to dockerhost from docker image

I am trying to use docker(dind) image for building an image. When I run docker info in the DockerFile, it complains dockerhost cannot be found. Is there any way when building a Docker image, can we use docker host in the build step ?
I don't think there is an effective way to run docker in DIND when building image via dockerfile. I ran a container version of DIND image and added all the config stuff and committed that to an image which solved the problem of me using dind

Docker: Find dockerfile of images

I'm interested in how some images are build, and would like to know where docker saves the images/Dockerfile. I'm using a Mac and the docker version is 1.9.0. On google I see a lot about boot2docker but I don't seem to have that executable. I simply click the Docker Quickstart terminal and I can do
$> docker run dockerinaction/hello_world
I noticed that for the hello-word image I can find the dockerfile on hub.docker.com, but for onedio/base-node5 I can't. Is it possible to find the Dockerfile for base-node5 on hub.docker.com ?
Use dockerfile-from-images from centurylinkabs, that will create the Dockerfile, see https://github.com/centurylinklabs/dockerfile-from-image
You can get a lot of that info from the Docker History command
docker history onedio/base-node5

Resources