Docker compose Building docker image running container


    Building docker image and running container using docker-compose


    version: ‘3’
    build: ../apache2docker/
    image: “dockcompose/apache2:1.0”
    container_name: dockercomposeapache2
    – “3308:80”

    FROM ubuntu:latest
    RUN apt-get update
    RUN apt-get install -y openssh-server
    RUN mkdir -p /var/run/sshd
    RUN mkdir -p /home/dockertest
    RUN useradd -d /home/dockertest dockertest
    RUN chown dockertest /home/dockertest
    RUN echo ‘dockertest:[email protected]$$w0rd’ | chpasswd
    RUN sed -i ‘s/PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ssh/sshd_config
    EXPOSE 22
    CMD [“/usr/sbin/sshd” , “-D”]

    Subscribe this channel to get periodic update
    Please click this link to subscribe my channel –

    Please visit these play lists as well

    Docker Fundamentals –
    Linux Basics –
    Linux Tips and Tricks –
    Cloudera Hadoop Administration –
    Cloudera Hadoop 6 –
    Bash Scripting –
    Hortonworks Data Platform3 –
    Hadoop Admin Q&A ––i
    Hadoop Security –
    HD Insight –
    HDP Administration –
    HDPCA –
    Cloudera Certified Administrator –
    HDP Upgrade –
    Puppet –
    Data Governance –


    Previous articleTikToks that are so funny i peed my pants 2
    Next articleMultiple node pools in Azure Kubernetes Service (AKS) | Azure Friday


    1. getting warning & error — any clue?
      Successfully tagged dockercompose/discoveryserver:0.0.1-SNAPSHOT

      WARNING: Image for service discoveryserver was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up –build`.

      Recreating 2150e863462a_compose_discoveryserver_1 … error

      ERROR: for discoveryserver no such image: sha256:e792743d82816ba4d2642d097e01c5aa02d8d213ff823aa40428a787cc8cdcb3: No such image: sha256:e792743d82816ba4d2642d097e01c5aa02d8d213ff823aa40428a787cc8cdcb3

      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.