I'm having trouble building dockers - docker

I ran normally from the docker hub to running the image.
But I'm having trouble executing 'build' command.
There appears to be a path problem, but any path given in the current working directory cannot be resolved. Can you give me any advice here?
(I am in wsl2 - ubuntu 20.04)

You don't need to pass the file name to build command, if the file name is Dockerfile just pass the context. use this instead:
docker build -t python-test .

Related

Docker container copy files from local path into container

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/

docker-compose docker-entrypoint-initdb.d Permission denied

I am trying to run the puppet pupperware suite (all 3 servers/puppet server/puppet DB/DB server).
I am using the official Yaml file provided by puppetlabs for docker compose : https://github.com/puppetlabs/pupperware/blob/master/docker-compose.yml
When I run that Yaml file in docker compose however, I am running into the following error (from docker-compose logs):
postgres_1 | ls: cannot open directory '/docker-entrypoint-initdb.d/': Permission denied
And as a result, the build fails (only the puppet server comes up, but not the other ones).
My docker host is a Fedora 33 virtual machine running inside a Proxmox environment. Proxmox runs on the physical host.
I have disabled SELinux, and I am running docker (moby) rootless. My local user (uid 1000) can run docker without sudo.
I believe I need to set permission in the container (probably via a Dockerfile) but I am not sure how to change that and I am not sure how to use a Dockerfile and docker-compose simultaneously.
thank you for your help
The docker-compose file is from the Puppet 6 era. The docker images that the Pupperware setup currently pulls, are latest, which is Puppet 7.
I got my pre-existing setup functioning again by changing the image names to:
puppet/puppetserver:6.14.1
postgres:9.6
puppet/puppetdb:6.13.1
Maybe this works for you as well.
well, since it's been a month and you have no answers I will tell try to help you with what I know.
You should put a Dockerfile in the root of your project. It contains commands to be run by the docker daemon AND the commands run by the linux inside the container. Then it runs through the contents of your docker-compose.yml and runs the commands in there.
So to solve the permission problem you should add RUN, which executes the linux command in Bash and add data to the folder.
Also look at this answer

Dockerfile: Repository not found when adding a name to the stage

I need to create a Docker image but am running into a problem I don't quite understand (I am not very experienced in using Docker).
The problem is the following line in my Dockerfile:
FROM sgrio/java-oracle:jdk_8 AS builder
Here is what happens:
me#here:~$ sudo docker build .
Sending build context to Docker daemon
Step 0 : FROM sgrio/java-oracle:jdk_8 AS builder
Pulling repository sgrio/java-oracle
INFO[0004] Repository not found
If i remove the "AS builder" from the line, the repository gets pulled without problems. However, I need to name the stage for referencing later in the Dockerfile, so removing it is (I assume) not an option.
What am I missing here? All my searches on the net says that this should work.
I am using Docker v1.6.2 on ubuntu 14.04.5 LTS.
I manually updated docker to version 17.06 and now it works as expected. Looks like the version that comes with Ubuntu 14.04 is not usable anymore.

Run docker-compose on Windows 7

I'm using Docker Toolbox to run docker containers on Windows. When I try to perform docker-compose up Docker cannot find docker-compose.yml. I must cd into container's directory or specify the file path using -f argument. How to get the path?
docker info shows Root Dir as /mtn/sda1/bla/bla which is virtual path and doesn't exist on my PC.
UPD: solved
You may have simply forgot to save the docker-compose.yml. check this first. Try this solution, it worked for me https://github.com/docker/compose/issues/129
hope you get it sorted

Docker save not working on Ubuntu 16.04

I am newbie to Docker areana. After couple of hours, I could build docker for my requirement and I am very excited.
I want to move this docker and load it on my AWS instance. To do this I tried docker save command, but got error.
docker save -o . captom
rename .docker_temp_924538595 .: device or resource busy
I made sure that docker is stopped. I even restarted daemon but no luck.
I found mistake in this...
I supplied "." (current directory) as output path, assuming that docker save will create file(s) here. But it required file path (not directory) ..

Resources