Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

building docker image from dockerfile

Tags:

docker

Here is my command in terminal to build image, sudo docker build -t actinbox3.2:latest .

I'm getting this error

" Step 0 : FROM iamdenmarkcontrevida/base
        Pulling repository iamdenmarkcontrevida/base
        INFO[0020] Repository not found"

Dockerfile

    # Dockerfile for base image of actInbox
    FROM iamdenmarkcontrevida/base

    MAINTAINER Denmark Contrevida<[email protected]>


    # Config files
    COPY config /actinbox_config/
    COPY script /actinbox_script/
    COPY database /actinbox_db/

    # Config pyenv
    RUN echo 'export PYENV_ROOT="/root/.pyenv"' >> /root/.bashrc && \
        echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> /root/.bashrc && \
        echo 'eval "$(pyenv init -)"' >> /root/.bashrc && \
    # Config Nginx
        rm /etc/nginx/sites-enabled/default && \
        ln -s /actinbox_config/actinbox.conf /etc/nginx/sites-enabled/actinbox.conf && \
    # Config PostgreSQL
        rm /etc/postgresql/9.3/main/pg_hba.conf && \
        ln -s /actinbox_config/pg_hba.conf /etc/postgresql/9.3/main/pg_hba.conf && \
    # Create DB & Restore database
        sh /actinbox_config/create_db_actinbox.sh && \
    # Delete template folder
        rm -r /actinbox_db/

Mydockerfile in Base

Dockerfile for base image of actInbox

    FROM ubuntu:14.04

    MAINTAINER Denmark Contrevida<[email protected]> 

    # Base services
    RUN apt-get update && apt-get install -y \
        git nginx postgresql postgresql-contrib

    # Install Pyenv, Python 3.x, django, uWSGI & psycopg2
    COPY config/install_pyenv.sh /tmp/install_pyenv.sh
    RUN sh /tmp/install_pyenv.sh

Please help me out or any idea why im getting this error? I have an account in docker hub...........

Thank you in advance!

like image 612
Den Contre Avatar asked Nov 18 '15 05:11

Den Contre


People also ask

Which command is used to build docker image from Dockerfile?

With Dockerfile written, you can build the image using the following command: $ docker build .

Can we create container from Dockerfile?

In order to build the container image, you'll need to use a Dockerfile . A Dockerfile is simply a text-based file with no file extension. A Dockerfile contains a script of instructions that Docker uses to create a container image.

Can I create my own docker image?

Create a Docker image from an existing container: In this case, you start with an existing image, customize it with the changes you want, then build a new image from it. Use a Dockerfile: In this case, you use a file of instructions -- the Dockerfile -- to specify the base image and the changes you want to make to it.


1 Answers

Basically, it can't find the iamdenmarkcontrevida/base image in dockerhub.

Did you build/push the base image?

docker build .
docker tag <local-image-id> iamdenmarkcontrevida/base:latest
docker push iamdenmarkcontrevida/base
like image 172
Rico Avatar answered Oct 11 '22 22:10

Rico