Some question on Boot2docker setup for build and run - linux

I’m a fresh beginner on bioinformatics. Recently, I start learning it with the book named “Bioinformatics with Python Cookbook (by Antao, Tiago)”. I met some issues while setting up Docker for Linux. Please see below for the issues:
I was trying to set up the Docker files following the author’s instruction, but I found some files were “failed to download”.
docker build -t bio
https://raw.githubusercontent.com/tiagoantao/bioinf-python/master/docker/2/Dockerfile
Then I still went ahead set up the container following the instruction:
“Now, you are ready to run the container, as follows: docker run -ti -p 9875:9875 -v YOUR_DIRECTORY:/data bio”
I typed as docker run -ti -p 9875:9875 -v C:/Users/guangliang/Desktop/Bioinformation/data bio
However, it gave me an error saying “Unable to find image “bio:latest” locally”.
Can anyone give me any suggestions on this? My thought could be the first step I missed downloading some files for setting the Dockers, but I am not sure if I can fetch these files.
Thank you so much for any comments!
Best regards
Johnny
I tried downloading the docker files a few time, but the error still appears
docker build -t bio
https://raw.githubusercontent.com/tiagoantao/bioinf-python/master/docker/2/Dockerfile
docker run -ti -p 9875:9875 -v C:/Users/guangliang/Desktop/Bioinformation/data bio
In the first issue, I found some files were “failed to download”.
In the 2nd issue, an error saying “Unable to find image “bio:latest” locally”. appears

Here you have a couple of problems:
1) It looks you do not download that docker file and build required docker image locally
2) You are getting that error about not finding image locally because of previous problem
So, you should do like this:
1) Download that Dockerfile (https://raw.githubusercontent.com/tiagoantao/bioinf-python/master/docker/2/Dockerfile). If you cant download that file for some reason, just open it at the git, select all content, copy, than in some folder on your computer make a new file, name it "Dockerfile" and paste the content.
2) Build locally image - go to the folder you download that dockerfile and execute following command:
docker build -t bio .
3)Run your container with docker run ... command

Related

My containers in portainer have disapeared and cannot be redeployed

I'm having issues now with my portainer. I run ubuntu with docker and portainer and I ran the apt-get upgrade and install command through the terminal to update some things. now when I go to the portainer all my containers are gone and when I go to deploy them again I get the:
failed to deploy a stack: Creating Container xxxxx Starting Error response from daemon: error while creating mount source path '/docker/ghost/mysql': mkdir /docker: read-only file system
At the time the only thing I could think of that maybe had created this issue was went ubuntu said there were updates to be installed so I let it install and then also ran the apt-get commands in terminal:
apt-get upgrade
apt-get install
My ubuntu storage has 80GB free (someone said may be a storage issue)
I was on the portainer slack channel trying to get help from a staff member he had me try "docker ps" which didn't work I had to try "sudo docker ps" which gave me that second error message listed above.https://docs.docker.com/engine/install/linux-postinstall/
permission denied while trying to connect to the docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permissions denied
I also went and tried the docker group add from the docker docs and tried adding the $USER to the docker group. I have done that also, it lets me run the hello-world from the terminal but still doesn't let me deploy on portainer.
I still get the same deploy error from portainer:
failed to deploy a stack: Creating Container xxxxx Starting Error response from daemon: error while creating mount source path '/docker/ghost/mysql': mkdir /docker: read-only file system
This was from one of the stacks I tried to redeploy since it has the /docker/"ghost"/mysql. Also, doesnt let me redeploy any other stacks tried that too.
Really unsure what to do and how to fix it since it basically now doesn't let me use any of those containers. Any help will be really appreciated, quite on edge right now! Thanks
I was kinda expecting not to have any of these issues. Not event entirely sure how it happened, I'm assuming maybe when I was using the "apt-get" commands. I don't really know myself. I would just like this fixed so I can get my data and containers back up and going on portainer. Yes, I also know portainer and docker are different and portainer is only a utility for docker.
edit: to add to this I have also re-installed portainer and docker not a full docker refresh but the standard one where it keeps some of the files since I dont want to remove some of the directories where some containers keep there configs and data files

Docker file ENTRYPOINT can't detect my start script

I'm trying to create a docker image. This image should run a shell script "startService.sh" when the container is created. The image was built successfully, but when trying to run the image, I get the following error:
"./startService.sh: 6: ./startService.sh: source: not found"
But I know I copied the startService.sh script into the image. My Dockerfile is shown below.
FROM openjdk:8
VOLUME /opt/att/ajsc/config
COPY startService.sh /startService.sh
RUN chmod 777 /startService.sh
ENTRYPOINT ./startService.sh
Where did I go wrong?
The error isn't saying that your start script isn't found; it's saying that the source command (which your script apparently uses) isn't found. source is a bash-specific synonym for the . command; if you want your script to be compatible with the Docker image's /bin/sh, you need to use . instead.

Docker: What's available in the parent image?

In docker how do I know what packages are available in the parent image I am using?
I am trying something like:
docker search python
but I get some (network?) error.
I have the image locally. How would I search what packages I can use?
docker search is the command you use to search for docker images on the docker hub.
If I understood well your question, given an image (say alpine:latest) you want to know what's inside that image.
If that's the case, the only thing you can do IMHO is just run the container and explore it.
You can do that for the alpine:latest image with the following command:
docker run --rm -ti alpine:latest ash
You'll get a prompt inside an instance of the mentioned image and you can dig around to check what's available.
There is no place where you can access informations about the content of an image in a structured way.

Docker Toolbox on Windows 7 sharing volume

I'm trying to setup a environment trough a docker container on my windows 7 computer. I have problems with mounting a folder to my container. When I run
docker run -it --volume /C/Users/Public/docker_share:/home --rm ubuntu bash
I'm getting no errors but I can't see my files from my windows host in docker:
cd /home
ls
is empty but on my windows computer I have a text file and a folder in C:/Users/Public/docker_share
I have found multiple threads related to this topic but no solution solved my problem.
(Docker version 17.03.1-ce, build c6d412e)
I had the same problem and after searching in many forums, someone posted the solution that worked for me.
When defining your volume, write the "c" lowercase (/c/Users/Public/doc). This seems odd, but it worked in my case, so just give it a try in case you haven't found the solution yet.

Haskell Stack Image Container Execute On Docker run

I am following the turorials from stackage and docker to run a haskell build via docker.
Building and Image creation works well and i can run the app via docker run -p 5000:5000 {imagename} {app-exe}
I am using the build in features of the latest stack to create the docke image with this minimal configuration.
image:
container:
base: "fpco/ubuntu-with-libgmp"
How can i make the image to launch the executable automatically, so that i can just type docker run -p 5000:5000 {imagename}. I know how to do it in a dockerfile but not with stack. I was thinking that I have to use:
entrypoints:
- appname-exe
No success, no matter if I just use the name of executable or the absolute path to it. Maybe I don't understand what the entrypoint is for.
I am using Docker for Mac.
Any suggestions appreciated.
Cheers
Bjorn
I figured it out myself. Everything is working correctly, I just didn't understand that stack creates two separate images. One just for the environment and one for the entrypoint.
So I checked docker images and found indeed two images. I was simply running the wrong image. This is correct
docker run -p 5000:5000 {imagename-app-exe}
Man sometimes you don't see the forest.

Resources