make an image in docker - docker

actually i have a project to develop ssi concept, and i use sovrin platform to develop ssi concept with indy network. and in the indy network documentation I followed the steps that were ordered, the first step was to create an image with docker. and when I practice the steps, I get out the following error message:
[internal] load build definition from indy-pool.dockerfile
sha256:549f00990a020075d136b14c21bb5758301e2db9ee6c7c664706a50642d2ff5d
transferring dockerfile: 71B 0.0s done
ERROR: error from sender: resolve : CreateFile ci: The system cannot find the file specified.
> [internal] load build definition from indy-pool.dockerfile:
failed to solve with frontend dockerfile.v0: failed to read dockerfile: error from sender: resolve : CreateFile ci: The system cannot find the file specified.
and here is the code I use
docker network create --subnet 10.0.0.0/8 indy_pool_network
docker build --build-arg pool_ip=10.0.0.2 -f ci/indy-pool.dockerfile -t indy_pool .
docker run -d --ip="10.0.0.2" --net=indy_pool_network indy_pool
what I'm trying at the moment is trying to create an image on my docker by following the guide or steps using the indy network sdk

judging by your error code, because you haven't created a folder or it could be that the image you are using is not found

Related

Dockerfile FROM command doesn't get image from insecure private registry

I can't find docs anywhere describing whether the "FROM" Dockerfile command will automatically pull from a remote private registry, or whether you must do an explicit "docker pull" first before running "docker build".
I have an insecure private registry set up at http://192.168.1.1:5000. It is configured in /etc/docker/daemon.json. Pushes and pulls both work against this insecure registry.
But if an image doesn't exist in the local cache (i.e., it hasn't been pulled and doesn't already exist from a previous docker build) then when running docker build the Dockerfile FROM command results in:
=> ERROR [internal] load metadata for 192.168.1.1:5000/reponame 0.1s
------
> [internal] load metadata for 192.168.1.1:5000/reponame:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head "https://192.168.1.1:5000/v2/reponame/manifests/latest": http: server gave HTTP response to HTTPS client
Strange that it is trying HTTPS even though it should know that the registry is insecure and thus use HTTP.
Anyway, is this normal behavior? Do I just need to always perform a "docker pull" for an image before attempting to reference it in a Dockerfile FROM command? Or am I missing something that would make this work without doing a pull first?
Posting answer for anyone who might run into this in the future. I finally found the root cause of this issue. Apparently the standard docker registry image doesn't respond to the http HEAD requests that DOCKER_BUILDKIT sends.
The workaround is to disable buildkit (set DOCKER_BUILDKIT=0 in environment). This falls back to the pre-buildkit logic, which doesn't make that HEAD call before pulling the image. Less efficient (and you lose some other buildkit advantages), but it works.
Alternatively, you can issue a pull command for the image before running the docker build, and FROM will pull from the local cache.

How to run dockerfile in cmd

I am using Windows 10 machine and new to docker technology.
I prepared the Dockerfile.txt file and kept inside the DockerFiles folder in local system.
and executed the below command.
docker build -t my-r-image .
But it is not able to read.
Can anyone please help?
The name is also correct.
Any suggestion will be highly appreciated.
Make sure your dockerfile has the same name as the one shown in your terminal, example:
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount320670870/Dockerfile: no such file or directory
The dockerfile needs no extension, in Windows, you can create it with notepad++ and save it as "all types (.)"
You can try typing the full path of your dockerfile:
docker build -t X:X O:\Users\yyy\XX

How do I build docker-compose container from source for x86_64 and an arm arch? (Please provide a source image with `from` prior to commit)

I am trying to build the docker-compose container from source. Ultimately I want two of these containers, one for x86_64 and one for an arm arch. I see that I can get the x86 compatible container with this script https://github.com/docker/compose/releases/download/1.25.5/run.sh, but I need to be able to build from source. I have cloned the compose repository and have tried two things, first just trying to build with the Dockerfile in the repo. The result:
>docker build -t docker-compose .
Sending build context to Docker daemon 1.872 MB
Step 1/39 : ARG DOCKER_VERSION=19.03.8
Please provide a source image with `from` prior to commit
I was then looking at the build scripts in script/build and tried executing the linux build script.
> script/build/linux
+ ./script/clean
++ script/build/write-git-sha
+ DOCKER_COMPOSE_GITSHA=9c5351cf
+ TAG=docker/compose:tmp-glibc-linux-binary-9c5351cf
+ docker build -t docker/compose:tmp-glibc-linux-binary-9c5351cf . --build-arg BUILD_PLATFORM=debian --build-arg GIT_COMMIT=9c5351cf
Sending build context to Docker daemon 1.872 MB
Step 1/39 : ARG DOCKER_VERSION=19.03.8
Please provide a source image with `from` prior to commit
I'm stuck here. My plan for the arm container is to use the linux build script but swap the ARCH to my arm architecture. Any help would be appreciated
I will answer this question if anyone happens upon it, because I have solve it. The issue was with my docker-version. You need an up to date docker version, and then clone the docker-compose repo and do docker build like shown above. To build an ARM version I had to make an ARM emulator with Qemu and do the same steps there.

Debugging docker-compose build that freezes on building first service

I have been following a tutorial on how to deploy docker containers to AWS, which I have managed to do successfully. However now that I have modified a flask web app with my own code/logic, it never completes building the first service.
My last command:
docker-compose -f docker-compose-prod.yml up -d --build
It stars to say:
Building feapi
Then nothing happens, sometimes I get:
ERROR: SSL error: ('The write operation timed out',)
How can I debug this or at least see what is happening behind the scene, as I am not sure what is causing the error? I know docker-compose offers logs but not sure how to implement it and if its necessary.
Sometimes your context contains too many files.
When the docker build starts, it collects all the files which is in your project folder/context dir, except if you mention them in the .dockerignore.
If you have GBs of files around, it can collect it for minutes and the resulting image size will be huge.
In the official docs (https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) see this paragraph:
"Omitting the build context can be useful in situations where your Dockerfile does not require files to be copied into the image, and improves the build-speed, as no files are sent to the daemon."
If you are uncertain about the size of your build context, you could run a simple docker build, which prints the context size it finds. Eg.:
> docker build -t check-context:latest .
Sending build context to Docker daemon 1.086MB
...
docker-composer --build does docker build for you.
If you run manually the docker build command, you will have the output of the build.
Then, docker build just runs the commmands of your Dockerfile this is up to you to put your Dockerfile commands in verbose / debug mode.

Error when building the blackbox_exporter Docker image

I am just getting started with Prometheus and I may be doing something wrong, but I am getting the following error when trying to build the blackbox_exporter (https://github.com/prometheus/blackbox_exporter) image with:
docker build -t blackbox_exporter .
Error being:
Step 3 : COPY blackbox_exporter /bin/blackbox_exporter
lstat blackbox_exporter: no such file or directory
When I edit the Dockerfile and update it to:
COPY . /bin/blackbox_exporter
Then it builds properly. Any ideas?
Thanks in advance.
David
Looking at the Makefile for that project, the docker image build happens after the application is built by promu. The container is designed to be a minimal environment of busybox and the application binary that you first create outside of docker.

Resources