Placing network restrictions with docker
Is it possible using a docker instance to place restrictions on a network. i.e. certain websites being restricted when using a sandbox browser?
See also questions close to this topic
Wordpress write-access when using Docker for Windows
I want to setup a local Wordpress dev environment, so I'm trying out Docker for Windows and WSL. I've used standard images (wordpress:4.9.7, mysql:5.7 and phpmyadmin/phpmyadmin) and use docker-compose. I can get Wordpress running, but run into problems when I try to update or add plugins.
I have this in the Wordpress service section of the docker-compose.yml:
volumes: - ./wp-content:/var/www/html/wp-content
This means that:
- I can edit theme and plugin files in the host (great), however...
- the container's /var/www/html/wp-content folder is root:root 755. So Wordpress can't update/add plugins or upload other files from the admin - and I can't chown or chmod this.
If I remove the volumes from docker-compose.yml I get write access back but I can't edit or persist the wp-content file from the host.
I just want an easy Wordpress dev environment. Is there a way to get this working with Docker for Windows, or will I have to go back to using a virtual machine?
DockerHub API implementations in Python 3
I'm working on a project with Python(3.6) in which I need to implement Docker Hub API to create a repository on user's docker hub account and push his docker image.
Real Scenario: User will provide his source code along with Dockerfile, his username and apikey of docker cloud, then I have to create a repository on his account and build a Docker image of his source code and push to his docker hub account.
Here's what I have tried:
tempdir = tempfile.mkdtemp() saved_unmask = os.umask(0o077) temp_dir_path = os.path.join(tempdir) archive_path = os.path.join(settings.MEDIA_ROOT, 'archives/', deployment.sourceFile.name) print(archive_path) # Extract uploaded archive inside temporary dir patoolib.extract_archive(archive_path, outdir=temp_dir_path) # Try to retrieve path of dockerfile directory docker_glob = os.path.join(temp_dir_path, "*", "Dockerfile") print(docker_glob) docker_file = glob.glob(docker_glob) docker_folder = os.path.dirname(docker_file) print(docker_folder) docker_client = docker.from_env() print("Start Building your docker image...") docker_client.login(username='USERNAME', password='PASSWORD') docker_client.images.build(path=docker_folder, gzip=False, tag=deployment.deploymentName) image = docker_client.images.get(deployment.deploymentName) shutil.rmtree(tempdir) img_id = image.short_id print(img_id)
As you can see currently I'm pushing the image to my own default/repo but I want to create a repo on user's account and then push the image to his own account. AND also, can I use
How can I achieve this thing?
Help me, please!
Thank You, Abdul
Missing JavaFX platform on openjdk alpine docker image
I'm running the image
openjdk:8-jre-alpine3.8on docker ,in K8s. And my image fails because of
Caused by: java.lang.ClassNotFoundException: javafx.application.Platform at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 23 common frames omitted
The straight forward solution would be to create an custom image that installs javafx but I'm looking for a more elegant solution. One which won't force me to host additional image files.
I thought of using busybox as init container but I'm not entirely sure how