databricks / docker-dev

Arcion Demo Kit for testing database to database replication
https://arcionlabs.github.io/docker-dev/
GNU General Public License v3.0
3 stars 0 forks source link

tmpfs and ramfs podman test on mac #52

Open robert-s-lee opened 1 year ago

robert-s-lee commented 1 year ago

https://www.redhat.com/sysadmin/replace-docker-podman-macos

docker run --name some-mysql -v /my/own/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag

podman run --name mysqlpodmanramfs --mount type=tmpfs,destination=/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Password -d mysql

/var/lib/mysql show tmpfs

pple:bash_completion.d rslee$ podman exec -it mysqlpodmanramfs bash
bash-4.4# df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
overlay        overlay   100G  3.0G   97G   3% /
tmpfs          tmpfs      64M     0   64M   0% /dev
shm            tmpfs      63M     0   63M   0% /dev/shm
tmpfs          tmpfs     196M  112K  196M   1% /etc/hosts
tmpfs          tmpfs     977M  200M  777M  21% /var/lib/mysql
devtmpfs       devtmpfs  4.0M     0  4.0M   0% /dev/tty

if it really fast

export SRCDB_ARC_USER=arcsrc
export SRCDB_ARC_PW=Passw0rd

create_user SRC ${SRCDB_ARC_USER} ${SRCDB_ARC_PW} "" 1
pple:bash_completion.d rslee$ podman machine init
Downloading VM image: fedora-coreos-38.20230918.2.0-qemu.aarch64.qcow2.xz: done  
Extracting compressed file: podman-machine-default_fedora-coreos-38.20230918.2.0-qemu.aarch64.qcow2: done  
Image resized.
Machine init complete
To start your machine run:

        podman machine start

pple:bash_completion.d rslee$ podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users:/Users
Mounting volume... /private:/private
Mounting volume... /var/folders:/var/folders

This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command:

        podman machine set --rootful

API forwarding listening on: /Users/rslee/.local/share/containers/podman/machine/qemu/podman.sock

The system helper service is not installed; the default Docker API socket
address can't be used by podman. If you would like to install it run the\nfollowing commands:

        sudo /opt/homebrew/Cellar/podman/4.7.0/bin/podman-mac-helper install
        podman machine stop/opt/homebrew/Cellar/podman/4.7.0/bin/podman-mac-helper; podman machine start/opt/homebrew/Cellar/podman/4.7.0/bin/podman-mac-helper

                You can still connect Docker API clients by setting DOCKER_HOST using the
following command in your terminal session:

        export DOCKER_HOST='unix:///Users/rslee/.local/share/containers/podman/machine/qemu/podman.sock'

Machine "podman-machine-default" started successfully
Error: the 'noswap' option is only allowed with rootful tmpfs mounts: must provide an argument for option
robert-s-lee commented 1 year ago

tmpfs has noexec that does not allow ./test.sh. needs to be mounted no exec

tmpfs on /opt/stage/tmpfs type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755,inode64)