SagiK-Repository / Learn-Git-Lab-CICD

Git Lab에서 CICD를 활용하는 방법을 익힌다. (Local)
0 stars 0 forks source link

Ubuntu Test Docker #2

Closed SAgiKPJH closed 8 months ago

SAgiKPJH commented 8 months ago
FROM ubuntu:18.04

# apt-util 설치 & sudo 설치 
RUN apt-get update && \
    apt-get install -y -qq --no-install-recommends \ 
    sudo \
    vim \
    openssh-server \
    git \
    curl \
    wget

RUN wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb --no-check-certificate
RUN sudo apt-get install -y ca-certificates
RUN sudo dpkg -i packages-microsoft-prod.deb
RUN rm packages-microsoft-prod.deb
RUN sudo apt-get update
# RUN sudo apt-get install -y aspnetcore-runtime-6.0
RUN sudo apt-get install -y dotnet-sdk-6.0

# mirero 추가 
ARG USER=mirero
ARG GROUP=mirero
ARG PASS="system"
RUN sudo addgroup $GROUP && \
    sudo useradd -m -s /bin/bash $USER -g $GROUP &&\
    echo "$USER:$PASS" | chpasswd

# mirero sudo 권한 주기 
RUN usermod -aG sudo mirero

# mirero 전환 
WORKDIR /home/mirero
USER $user
CMD /bin/bash
RUN su mirero

RUN sudo service ssh start 
SAgiKPJH commented 8 months ago
docker build -t ubuntu_jju .
docker run -it --name first-ubuntu -p 18080:22  ubuntu_jju /bin/bash
SAgiKPJH commented 8 months ago
cd CSharpTest
dotnet build CSharpTest.sln
dotnet test ./UnitTestProject1/UnitTestProject1.csproj
SAgiKPJH commented 8 months ago

Window에서만 돌아가는 Build

image image