Skip to content

Commit ada879c

Browse files
authored
[CI] Build and push a Docker image (loic-sharma#207)
1 parent d782e13 commit ada879c

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.azure/pipelines/ci-official.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,29 @@ jobs:
1111
pool:
1212
vmImage: ubuntu-16.04
1313
steps:
14-
- script: docker build -t baget .
14+
- task: Docker@1
1515
displayName: Build docker image
16+
inputs:
17+
command: build
18+
dockerFile: Dockerfile
19+
imageName: loicsharma/baget:$(Build.SourceVersion)
20+
21+
- task: Docker@1
22+
displayName: Tag latest docker image
23+
condition: eq(variables['build.sourcebranch'], 'refs/heads/master')
24+
inputs:
25+
command: tag
26+
imageName: loicsharma/baget:$(Build.SourceVersion)
27+
arguments: loicsharma/baget:latest
28+
29+
- task: Docker@1
30+
displayName: Push docker image
31+
condition: eq(variables['build.sourcebranch'], 'refs/heads/master')
32+
inputs:
33+
command: push
34+
containerRegistryType: 'Container Registry'
35+
dockerRegistryEndpoint: 'Docker Hub'
36+
imageName: loicsharma/baget
1637

1738
- job: Artifacts
1839
pool:

docs/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ You will need to add the symbol location `http://localhost:5000/api/download/sym
3333

3434
If you'd like, you can run BaGet on Docker:
3535

36-
1. Build the docker image:
36+
1. Pull the latest docker image:
3737

3838
```
39-
docker build . -t baget
39+
docker pull loicsharma/baget
4040
```
4141

4242
2. Create a file named `baget.env` with the content:
@@ -59,7 +59,7 @@ Search__Type=Database
5959
4. Run:
6060

6161
```
62-
docker run --rm --name nuget-server -p 5555:80 --env-file baget.env -v "$(pwd)/baget-data:/var/baget" baget:latest
62+
docker run --rm --name nuget-server -p 5555:80 --env-file baget.env -v "$(pwd)/baget-data:/var/baget" loicsharma/baget:latest
6363
```
6464

6565
5. Push your first package with:
@@ -68,4 +68,4 @@ docker run --rm --name nuget-server -p 5555:80 --env-file baget.env -v "$(pwd)/b
6868
dotnet nuget push -s http://localhost:5555/v3/index.json -k NUGET-SERVER-API-KEY newtonsoft.json.11.0.2.nupkg
6969
```
7070

71-
6. Open the URL `http://localhost:5555/` in your browser
71+
6. Open the URL `http://localhost:5555/` in your browser

0 commit comments

Comments
 (0)