Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit d0deb69

Browse files
paulbouwerjackfrancis
authored andcommitted
Add support to build official Docker image from release binaries. (#1659)
1 parent d80b5c7 commit d0deb69

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

releases/Dockerfile.linux

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM alpine:3.6
2+
3+
ARG ACSENGINE_VERSION
4+
ARG BUILD_DATE
5+
6+
# Metadata as defined at http://label-schema.org
7+
LABEL maintainer="Microsoft" \
8+
org.label-schema.schema-version="1.0" \
9+
org.label-schema.vendor="Microsoft" \
10+
org.label-schema.name="Azure Container Service Engine (acs-engine)" \
11+
org.label-schema.version=$ACSENGINE_VERSION \
12+
org.label-schema.license="MIT" \
13+
org.label-schema.description="The Azure Container Service Engine (acs-engine) generates ARM (Azure Resource Manager) templates for Docker enabled clusters on Microsoft Azure with your choice of DCOS, Kubernetes, or Swarm orchestrators." \
14+
org.label-schema.url="https://github.com/Azure/acs-engine" \
15+
org.label-schema.usage="https://github.com/Azure/acs-engine/blob/master/docs/acsengine.md" \
16+
org.label-schema.build-date=$BUILD_DATE \
17+
org.label-schema.vcs-url="https://github.com/Azure/acs-engine.git" \
18+
org.label-schema.docker.cmd="docker run -v \${PWD}:/acs-engine/workspace -it --rm microsoft/acs-engine:$ACSENGINE_VERSION"
19+
20+
RUN apk add --update bash curl && \
21+
rm -rf /var/cache/apk/*
22+
23+
RUN curl -L "https://github.com/Azure/acs-engine/releases/download/v${ACSENGINE_VERSION}/acs-engine-v${ACSENGINE_VERSION}-linux-amd64.tar.gz" | tar xvz -C ~ && \
24+
chown -R root:root ~/acs-engine-v${ACSENGINE_VERSION}-linux-amd64 && \
25+
ln -s ~/acs-engine-v${ACSENGINE_VERSION}-linux-amd64/acs-engine /usr/local/bin/acs-engine && \
26+
chmod +x /usr/local/bin/acs-engine && \
27+
echo 'PS1="acs-engine# "' > ~/.bashrc
28+
29+
WORKDIR /acs-engine/workspace
30+
31+
CMD bash

releases/README.Dockerfile.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Build Docker image
2+
3+
**Bash**
4+
```bash
5+
$ VERSION=0.8.0
6+
$ docker build --no-cache --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg ACSENGINE_VERSION="$VERSION" -t microsoft/acs-engine:$VERSION --file ./Dockerfile.linux .
7+
```
8+
**PowerShell**
9+
```powershell
10+
PS> $VERSION="0.8.0"
11+
PS> docker build --no-cache --build-arg BUILD_DATE=$(Get-Date((Get-Date).ToUniversalTime()) -UFormat "%Y-%m-%dT%H:%M:%SZ") --build-arg ACSENGINE_VERSION="$VERSION" -t microsoft/acs-engine:$VERSION --file .\Dockerfile.linux .
12+
```
13+
14+
# Inspect Docker image metadata
15+
16+
**Bash**
17+
```bash
18+
$ docker image inspect microsoft/acs-engine:0.8.0 --format "{{json .Config.Labels}}" | jq
19+
{
20+
"maintainer": "Microsoft",
21+
"org.label-schema.build-date": "2017-10-25T04:35:06Z",
22+
"org.label-schema.description": "The Azure Container Service Engine (acs-engine) generates ARM (Azure Resource Manager) templates for Docker enabled clusters on Microsoft Azure with your choice of DCOS, Kubernetes, or Swarm orchestrators.",
23+
"org.label-schema.docker.cmd": "docker run -v ${PWD}:/acs-engine/workspace -it --rm microsoft/acs-engine:0.8.0",
24+
"org.label-schema.license": "MIT",
25+
"org.label-schema.name": "Azure Container Service Engine (acs-engine)",
26+
"org.label-schema.schema-version": "1.0",
27+
"org.label-schema.url": "https://github.com/Azure/acs-engine",
28+
"org.label-schema.usage": "https://github.com/Azure/acs-engine/blob/master/docs/acsengine.md",
29+
"org.label-schema.vcs-url": "https://github.com/Azure/acs-engine.git",
30+
"org.label-schema.vendor": "Microsoft",
31+
"org.label-schema.version": "0.8.0"
32+
}
33+
```
34+
35+
**PowerShell**
36+
```powershell
37+
PS> docker image inspect microsoft/acs-engine:0.8.0 --format "{{json .Config.Labels}}" | ConvertFrom-Json | ConvertTo-Json
38+
{
39+
"maintainer": "Microsoft",
40+
"org.label-schema.build-date": "2017-10-25T04:35:06Z",
41+
"org.label-schema.description": "The Azure Container Service Engine (acs-engine) generates ARM (Azure Resource Manager) templates for Docker enabled clusters on Microsoft Azure with your choice of DCOS, Kubernetes, or Swarm orchestrators.",
42+
"org.label-schema.docker.cmd": "docker run -v ${PWD}:/acs-engine/workspace -it --rm microsoft/acs-engine:0.8.0",
43+
"org.label-schema.license": "MIT",
44+
"org.label-schema.name": "Azure Container Service Engine (acs-engine)",
45+
"org.label-schema.schema-version": "1.0",
46+
"org.label-schema.url": "https://github.com/Azure/acs-engine",
47+
"org.label-schema.usage": "https://github.com/Azure/acs-engine/blob/master/docs/acsengine.md",
48+
"org.label-schema.vcs-url": "https://github.com/Azure/acs-engine.git",
49+
"org.label-schema.vendor": "Microsoft",
50+
"org.label-schema.version": "0.8.0"
51+
}
52+
```
53+
54+
# Run Docker image
55+
56+
```
57+
$ docker run -v ${PWD}:/acs-engine/workspace -it --rm microsoft/acs-engine:0.8.0
58+
```

0 commit comments

Comments
 (0)