Docker compose Building docker image running container

preview_player
Показать описание
Building docker image and running container using docker-compose

version: '3'
services:
ubuntuwebserver:
build: ../apache2docker/
image: "dockcompose/apache2:1.0"
container_name: dockercomposeapache2
ports:
- "3308:80"

Dockerfile
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:P@$$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 visit these play lists as well

Рекомендации по теме
Комментарии
Автор

very helpful to understand difference between Dockerfile & docker compose. No where else its explained so nicely as you did. Thanks.

sandipaonwww
Автор

Thanks for your video. Very helpful <3

hirenpatel
Автор

It's very helpful video.. thanks bro

vijaych
Автор

Is it possible to recover the old container which got removed during upgrade ..that upgrade is not successful too

rojayadav