I’m using docker toolbox
docker version 18.03.0-ce
my windows is 10
I’m having trouble setting up a scenario.
1- I need to run a linux (can be ubuntu), with php 7.1, apache and mysql,
2 - I need to configure my environment with hash, because my code uses the ioncube and I need to install linux to place “ioncube_loader_lin_7.1.so” in the path identified in php info extension_dir
Currently:
I made a test creating a dockerfile to create a run an image I found on the internet: FROM tecadmin / ubuntu-ssh: 16.04 where it updates and installs apache2
I do not know if this is the best way but it’s the one that works for me
FROM tecadmin/ubuntu-ssh:16.04
RUN echo "init \n"
RUN apt-get update \
&& apt-get install -y apache2
RUN echo "End \n"
COPY public/ /var/www/html/
WORKDIR /var/www/html
CMD ["apachectl", "-D", "FOREGROUND"]
EXPOSE 80
87/5000
Then I created a docker-compose with mysql and an apache image to test and is running:
I am lost because there are many images on the internet and I do not know which one to use in my case for a better result.
For it seems that each image has a form of configuration, and this displays several types of errors, distinct, some with volumes, others related to displaying the result in the url.
But my concern is to master the concept of the thing, so I am creating.
Some of my difficulties, for example, in the code above:
If I create a volume in docker-compose by pointing my root folder to / var / www / html / folder when building the “docker-compose build” image and running docker-compose up, the url of this path stops working, http://192.168.99.100/ displays empty folder, even having an index.html.
These are things I do not understand, I figured I could use volumes to transfer from my machine to the container.
When you say “root folder”, does this folder contain the web files?
because when you put in the web files, in the build process, and you decide to mount the folder in the container afterwards, the /var/www/html will be empty, IF the folder you mount on your host, is empty
you dont need to build every time.
once you build your image, you dont need to touch it, unless you are making updates to it.
To see a list of your images: docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
f25ed8361486 2 hours ago 326MB
apache latest 9c2d6fa21e89 2 hours ago 326MB
27763c422963 2 hours ago 326MB
f215b9d5f3b6 3 hours ago 326MB
b737792a39f0 20 hours ago
so eecuted
docker stop (docker ps -a -q)
docker rm (docker ps -a -q)
and
docker rmi image $(docker images -a -q)
and executed docker-machine stop and start
my docker-machine env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="C:\Users\andre\.docker\machine\machines\default"
export DOCKER_MACHINE_NAME="default"
export COMPOSE_CONVERT_WINDOWS_PATHS="true"
Run this command to configure your shell:
eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)
but docker-compose build
“db uses an image, skipping
web uses an image, skipping”
my docker images is empty now
so i execute docker-compose up -d
and now im my download process:
Pulling web (apache:latest)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.
Continue with the new image? [yN]y
Pulling web (apache:latest)...
ERROR: pull access denied for apache, repository does not exist or may require 'docker login'
As I’m using the toolbox, it depends on the virtualbox to run, inside it configures which folder should be shared, in my case it was c / Users, I just needed to choke my project here and I managed to make the volumes work.