Permission issue with Podman - containers

I have installed Podman on Ubuntu 18.04 and it seemed to install without issue but...
When I type podman--version I get:
podman version 1.3.0-dev
But if I then type podman ps I get:
Error: could not get runtime: cannot make directory /home/redacted/.config/containers: mkdir /home/redacted/.config/containers: permission denied
I'm not sure why this is happening.

Podman when running rootless attempts to create content in the home directory. In this case it looks like the homedir is /home/redacted.
The user running podman is not allowed to write to the homedir /home/redacted.

Related

Podman oci .containerenv: not a directory

I recently swithed back to podman and got a error with my containers.
Containerfile:
FROM scratch
ADD ./run /
ENTRYPOINT ["/run"]
My applications are all static build go microservices:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o ${BINARY_NAME} *.go
Everything is managed from a Makefile.
Under docker everything worked great, but with podman i get this error.
Error: OCI runtime error: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/run/containers/storage/overlay-containers/5709a135a4f1537fea1fdf8a5750534bc0f782671f115e73201569495024e4fc/userdata/.containerenv" to rootfs at "/run/.containerenv" caused: mount through procfd: open o_path procfd: open /var/lib/containers/storage/overlay/cc55a7c625e1483cc644660c8161db8a4a4a8b9c1120d132f07593834fda1a2c/merged/run/.containerenv: not a directory
My run command is
podman run -d localhost/test:1.0.0
OS information: Ubuntu 21.04
Kernel: 5.11.0-22-generic
Podman: 3.0.1
When i use another container like alpine, it works great under podman.
Just to be sure, do not name the executables, like standard linux directories.
Thanks to Erik Sjölund

Can't launch an instance of the Docker image to run Mysql Server on Mac M1

I'm installing MySQL server on my MacBook (M1 Chip). I run the following command to download the MySQL server
sudo docker pull mcr.microsoft.com/mssql/server:2019-latest
Then I run the following command to launch an instance of the Docker I just downloaded:
docker run -d --name sql_server_demo -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=mypassword' -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest
But it pull a warning
WARNING: The requested image's platform (linux/amd64) does not match
the detected host platform (linux/arm64/v8) and no specific platform
was requested
559ff6b849b6e62cbdbfa3d7cde403f314798bffb4c1622aab8e305d3b49df97
Any one know how to fix this?
Try downloading using mac with apple chip
https://hub.docker.com/editions/community/docker-ce-desktop-mac?tab=description
I managed to solve this by installing mariadb instead of mysql

Problem with virsh / cannot connect to qemu

I am trying to setup KVM, but when running $ sudo virsh net-define br10.xml I get this:
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
And when jumping into virt-manager GUI a get this dialog Unable to connect to libvirt qemu:///system.
I checked if I am in both kvm and libvirt groups and that seems okay.
I also checked if the libvrt-sock file is created when running $ sudo systemctl start libvirtd.service but there is nothing.
So it showed up that privilges for my files wasn't set correctly. Now everything works

Installing gogs persistent on minishift

I'm trying to install gogs on minishift with persistentVolumes.
I did this:
c:\> oc login -u system -p admin
c:\> oc new-project cicd
c:\> oc create -f https://raw.githubusercontent.com/OpenShiftDemos/gogs-openshift-docker/master/openshift/gogs-persistent-template.yaml
from the webconsole I load and execute the imported yaml template and I have gogs and postgresql up and running as you can see in the image below
Unfortunately, when I try to do this first installation of gogs I stuck in this error:
I know the issue is that gogs docker can access in write mode on /etc/gogs/conf/ dir.
How can I solve this on minishift?
thx
fabrizio

Something goes wrong with the SSH while setting up hadoop

I'm a new fish for hadoop.I installed Ubuntu 12.10 on my computer and I wanna install Hadoop in pseudo-distributed mode on one single node.I searched and get lots of tutorials but I have a problem with the SSH.I did what the tutorial said.
I am sure the problem is about the SSH.I get the openssh-server,and had done this:
hadoop00#WebsoftStation:~$ssh-keygen -t dsa -P "" -f ~/.ssh/id_dsa
hadoop00#WebsoftStation:~/.ssh$cat ~/.ssh/id_dsa.pub >> authorized_keys
Then I can successfully ssh my localhost like this:
hadoop00#WebsoftStation:~$ssh localhost
It worked.
So I changed the path to hadoop and then:
hadoop00#WebsoftStation:/usr/local/hadoop$ sudo bin/start-all.sh
[sudo] password for hadoop00:
starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-root-namenode-WebsoftStation.out
root#localhost's password:
root#localhost's password: localhost: Permission denied, please try again.
So,what's the problem?
You have setup password-less ssh for only your current account. Since, when you can use ssh localhost without any problem, the thing you need to do next is giving execution permission to your scripts.
Execute the following commands:
chmod +x bin/*.sh ---> assigns execution permission to all the scripts
./start.all ----> executes the script
Note: Hadoop can also be run without having password-less ssh setup using hadoop-daemon.sh script. The only advantage with password-less ssh is that, the ./start.all, script will take the trouble of doing that on behalf of you in each of the nodes.
You need to change permissions for your Hadoop folder to be owned by the hadoop00 user:
cd /usr/local/
sudo chown -R hadoop00:hadoop00 /usr/local/hadoop
Then you can cd into the sbin folder and run things without sudo. If you use sudo you're running the scripts as root which has different environment variables etc which is why you have a different behavior.
Why are you using sudo this is clearly a permission problem.
Try running this without sudo
bin/start-all.sh