Need to create amq63-openshift base image locally using docker file - docker

For security reason I can not directly pull amq63-openshift base image from redhat registry( https://registry.access.redhat.com/v2/jboss-amq-6/amq63-openshift/tags/list).
Is there a way to create amq63-openshift same base image using docker file?

Related

.NetCore Api Docker Image is not working when pulled from DockerHub

Created a .net core (3.1) API which depends on MongoDB and created a docker image for this project (which is working fine in my system). I am pushing this image to a private repository.
When pulling the image from another system/host/machine, The image is not working and giving error exited with code 0
I am very new to Docker and not finding how to pull the image to a new system and start using it.
Below are the steps I did.
Using Docker-Compose.yml to create supported images.
these are the images created in my system.
Commands I am using to tag the image and push
docker tag 9aa28f48b025 myusername/reponame
docker push myusername/reponame
Commands I am using to pull in another system.
docker login -- (using credentials)
docker pull myusername/reponame
Is my understanding of reusing images wrong? Any reference or suggestion will be a great help

How to create image by downloading manifest file and its blobs?

As in title - is it possible to create an image from its manifest.json file and blobs that comes from Docker Registry?
Docker has 'save' command which is able to create .tar file of image, but when I look inside that file it has more files and folders that let say standaolne manifest file and its blobs.
I would like to fetch manifest from registry, then its blobs, nextly pack it into .tar file and then be able to create that image using Docker's 'load' command. Can I do that by having only image manifest and its blobs?
It's a bit of a hack but you can setup a local registry where you want to load the image and then follow the steps to push an image to registry using blobs and manifests as specified in Docker Registry API Docs.
After that, you only need to pull the image from the registry using docker pull.

How to use openshift source-to-image library instead of s2i binary or executable file

How to use openshift source-to-image library https://github.com/openshift/source-to-image using go language,instead of s2i executable to build a new image from existing builder images from docker hub.
I need to create a new image by using above library and not using s2i.exe.
I have tried using https://github.com/openshift/source-to-image/blob/master/pkg/build/strategies/dockerfile/dockerfile.go Build function but it gives me an error.
Can anyone tell me or atleast guide me how to use this library to create a new image from existing docker hub builder images, by not using s2i executable.
Thanks in advance

Different images in containers

I want to create separated containers with a single service in each (more or less). I am using the php7-apache image which seems to use a base image of debian:jessie, php7 and apache. Since apache and php in this case are pretty intertwined I don't mind using this container.
I want to start adding other services to their own containers (git for example) and was considering using a tiny base image like busybox or alpinebox for these containers to keep image size down.
That said, I have read that using the same base image as other containers only gives you the 'penalty' of the one time image download of the base OS (debian jessie) which is then cached - while using tiny OSes in other containers will download those OSes on top of the base OS.
What is the best practice in this case? Should I use the same base image (debian jessie) for all the containers in this case?
You may want to create a base image from scratch. Create a base image from scratch.
From docker documentation
You can use Docker’s reserved, minimal image, scratch, as a starting point for building containers. Using the scratch “image” signals to the build process that you want the next command in the Dockerfile to be the first filesystem layer in your image.
While scratch appears in Docker’s repository on the hub, you can’t pull it, run it, or tag any image with the name scratch. Instead, you can refer to it in your Dockerfile. For example, to create a minimal container using scratch:
This example creates the hello-world image used in the tutorials. If you want to test it out, you can clone the image repo

How to make tweaks to a Docker base image?

How would one go about making tweaks to a docker base image before or during docker build?
For instance, the rails Docker base image as-is will install Ruby 2.2. What if we want Ruby 2.1.5? Or, what if we want Ubuntu 12.04 instead of 14.04?
Another way of looking at this is how to create custom containers by tweaking the upstream of base images.
You can't and shouldn't. A docker image once built mustn't be changed since the idea is to have a consistent environment for our applications.
You can create your own docker file based on the rails image (most publicly available images will have their Dockerfile available to view too) and change the step that installs rails to suit you. Of course this will be a NEW image.

Resources