-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotes.txt
More file actions
56 lines (45 loc) · 1.58 KB
/
Copy pathNotes.txt
File metadata and controls
56 lines (45 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Get base SDK Image from Microsoft
FROM mcr.microsoft.com/dotnet/core/sdk:5.0 AS built-env
WORKDIR /app
#Copy csproj file and restore any dependencies (via NUGET)
COPY *.csproj ./
RUN dotnet restore
#Copy the project file and build our releases
COPY . ./
RUN dotnet publish -c Release -o out
#Generate Runtine image
FROM mcr.microsoft.com/dotnet/core/sdk:5.0
WORKDIR /app
EXPOSE 80
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet","DockerAPI.dll"]
To remove all Docker Images in System for linux command is:->
sudo docker rmi -f $(sudo docker images -aq)
To use docker without Sudo use :->
sudo usermod -aG docker ${USER}
Then Restart
Login on Docker in Linux by :->
docker login
When we wrote instructions in Dockerfile then to build that in Docker image use this:->
sudo docker build -t dhanurdock/dockerapi .
You should see this thing after entering the command in terminal
Successfully built 9429d189235c
Successfully tagged dhanurdock/dockerapi:latest
It means the Dockerfile successfully built the images for this
Now it's turn to run it use this command :->
sudo docker run -p 8080:80 dhanurdock/dockerapi
Finally finally push this in your Dockerhub
docker push dhanurdock/dockerapi
You'll see this message in Terminal
61fac60e7652: Pushed
e8c9b1812c81: Pushed
c3e6dffd15cc: Pushed
a8576e875051: Pushed
b6414f5516ef: Pushed
ac7127334263: Pushed
f403f6573e99: Pushed
8d650ca022e2: Pushed
068c0c45d9f4: Pushed
f18b02b14138: Pushed
latest: digest: sha256:267b71e7cbd179037232cde68aff581e5de5c0e98b7a6275353204ed88013e84 size: 2426
It means you successfully pushed into your docker