Configure Docker Desktop's run command - docker

Fairly basic question here: How do I specify which ports are exposed for a container through docker desktop (e.g. a command like docker run -d -p 5000:5000 image)? I have non-technical users so want to stay off the CLI if possible

After you downloaded the image. Click on run
Expand Optional settings
And fill in the required configuration variables.

Related

Docker - Change existing containers settings without RUN command

Is it possible to change the settings of docker container like entrypoint, ports or memory-limits without having to delete the container and run using docker run command? Example: docker stop <container_id>, change settings and then docker start <container_id>?
When you use docker run -d image_name, some images tries to initialize from start and as a result I can't use the same volume.
Is it possible to change the settings by stopping the container instead of re-run?
You need to stop, delete, and recreate the container.
# this is absolutely totally 100% normal and routine
docker stop my_container
docker rm my_container
# docker build -t image_name .
docker run -d -p 12345:8000 --name my_container image_name
This isn't specific to Docker. If you run any command in any Unix-like environment and you want to change its command-line parameters or environment variables, you need to stop the process and create a new one. A Docker container is a wrapper around a process with some additional isolation features, and for a great many routine things you're required to delete the container. In cluster container environments like Kubernetes, this is routine enough that changing any property of a Deployment object will cause all of the associated containers (Kubernetes Pods) to get recreated automatically.
There are a handful of Docker commands that exist but are almost never used in normal operation. docker start is among these; just skip over it in the documentation.
When you use docker run -d image_name, some images tries to initialize from start and as a result I can't use the same volume.
In fact, the normal behavior of docker run is that you're always beginning the program from a known "clean" initial state; this is easier to set up as an application developer than trying to recover from whatever state the previous run of the application might have been left in.
If you need to debug the image startup, an easy thing to do is to tell the container to run an interactive shell instead of its default command
docker run --rm -it image_name /bin/sh
(Some images may have bash available which will be more comfortable to work in; some images may require an awkward docker run --entrypoint option.) From this shell you can try to manually run the container startup commands and see what happens. You don't need to worry about damaging the container code in any particular way, since anything you change in this shell will get lost as soon as the container exits.

Using Docker with official Progress OpenEdge RDBMS images

I found out that Progress has provided official docker images for their RDBMS.
I managed to pull the following image:
docker pull store/progresssoftware/oedb:12.2.3_adv-ent
I tried following the instructions to set it up, but they ask you to edit files inside the image?.
I'm not totally sure if they want me to only use the zip versions of the images or pull the images directly from the docker hub? Or is the idea to create my own Dockerfile where I use these as base images, and then set and create the required files and changes there? I couldn´t find anyone using these images in the web.
Could somebody provide me with example ´docker run´ command or ´Dockerfile´ to use these things?
beware that these images are for development and testing purposes only - they are not supported for production
The custom container images can then be used to bring up and dispose of database instances on demand for the purposes of incrementally building and testing OpenEdge applications
docker load vs docker run
You use docker load when you have docker image in archive format. Sometimes you do not want to push image to public places and you do not have private repository.
In this case you can do docker save. This command generates archive of your container. Then you can send this archive to private ftp.
To get this image you need:
Download image
Run docker load
When your image is uploaded to docker repository and you have rights to get it, you can use docker pull command. This is preferred command.
Unfortunately I have no idea how to run this enterprise tool, but they provide instruction here: https://docs.progress.com/bundle/openedge-database-docker-container/page/Run-an-OpenEdge-database-Docker-container-image.html
So example is:
docker run -d -p <database_server_port>:<database_server_port> -p <database_minport>-<database_maxport>:<database_minport>-<database_maxport> -e DB_BROKER_PORT=<database_server_port>
-e DB_MINPORT=<database_minport> -e DB_MAXPORT=<database_maxport> <custom_image_name>
you may use it as:
docker run -d -p 5432:5432 -p 5435-5440:5435-5440 -e DB_BROKER_PORT=5444
-e DB_MINPORT=5435 -e DB_MAXPORT=5440 store/progresssoftware/oedb:12.2.3_adv-ent
UPD: correct port forwarding syntax

Docker: how to map to a directory on a running instance?

I run Joomla image with :
docker run --name some-joomla --link test-mysql:mysql -p 8080:80 -d joomla
How can I change Joomla files ?
I think it is possible when specifying volume mapping, but I did not use that to run Joomla: is there a way to access Joomla files now ?
If I understand your question correctly, this thread should help you out.
Commit your container and create a new image from it.
Run a container from your just created image (and add the volume you need). Watch out for the port mappings, you either have to use other ports temporarily to check functionality of your new container, or you do step 3 beforehand.
If all works out, stop the old one.
If you want to check what's currently in the container, you can jump into it by running docker exec -it some-joomla bash (or sh, whatever Shell is installed in this image). You can then look for the files you want inside the container.
If you found them and you want to copy them on your local machine, you can run docker cp some-joomla:/your/path /path/on/local/machine.

Link mysql to application in docker

Hi how would I connect a mysql container to another container so that my application in one of those container can use Mysql? Based on this reference I need to run this
docker run --name some-app --link some-mysql:mysql -d application-that-uses-mysql
But I have no idea what does some-app mean and the application-that-uses-mysql? does it mean the container ID that will use it? below is the list of the running container
--name some-app refers to the container name you want to assign to the container you are running.
application-that-uses-mysql refers to the image which you are using. This image requires mysql and you have connecte myqsl to this image by using the command --link some-mysql:mysql.
However, Links are deprecated but you still can connect to other containers using networks. An answer here should be able to help you out in setting the connections.
Edit: Removed duplicate and provided complete answer.
--name some-app gives the newly started container the name some-app.
--link some-mysql:mysql links the container with name some-mysql (this is the one running MySQL) to the new container so that it can be accessed as mysqlwithin the container.
application-that-uses-mysqlis the name of the image containing your app.
If you are unsure about the meaning of some parameters, there is always the documentation.

How do I build docker images without docker?

Is there some lightweight way I can build a docker image within a container without having a working docker machine. Here's what I'm trying to do:
$ docker run -it --rm docker:latest
/ # mkdir test
/ # touch test/Dockerfile
/ # docker build test
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Assuming I had a valid Dockerfile in place, is there some way I could create an docker image from within a container like this?
Part of the problem could be that you're missing the --privileged flag, but in general, your questions can probably be answered here: https://hub.docker.com/_/docker/
And you might take the time to read the blog linked there detailing some of the pitfalls of using docker-in-docker.

Resources