forked from Azure/acs-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to build official Docker image from release binaries. (Az…
- Loading branch information
1 parent
d80b5c7
commit d0deb69
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM alpine:3.6 | ||
|
||
ARG ACSENGINE_VERSION | ||
ARG BUILD_DATE | ||
|
||
# Metadata as defined at http://label-schema.org | ||
LABEL maintainer="Microsoft" \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.vendor="Microsoft" \ | ||
org.label-schema.name="Azure Container Service Engine (acs-engine)" \ | ||
org.label-schema.version=$ACSENGINE_VERSION \ | ||
org.label-schema.license="MIT" \ | ||
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." \ | ||
org.label-schema.url="https://github.com/Azure/acs-engine" \ | ||
org.label-schema.usage="https://github.com/Azure/acs-engine/blob/master/docs/acsengine.md" \ | ||
org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.vcs-url="https://github.com/Azure/acs-engine.git" \ | ||
org.label-schema.docker.cmd="docker run -v \${PWD}:/acs-engine/workspace -it --rm microsoft/acs-engine:$ACSENGINE_VERSION" | ||
|
||
RUN apk add --update bash curl && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
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 ~ && \ | ||
chown -R root:root ~/acs-engine-v${ACSENGINE_VERSION}-linux-amd64 && \ | ||
ln -s ~/acs-engine-v${ACSENGINE_VERSION}-linux-amd64/acs-engine /usr/local/bin/acs-engine && \ | ||
chmod +x /usr/local/bin/acs-engine && \ | ||
echo 'PS1="acs-engine# "' > ~/.bashrc | ||
|
||
WORKDIR /acs-engine/workspace | ||
|
||
CMD bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Build Docker image | ||
|
||
**Bash** | ||
```bash | ||
$ VERSION=0.8.0 | ||
$ 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 . | ||
``` | ||
**PowerShell** | ||
```powershell | ||
PS> $VERSION="0.8.0" | ||
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 . | ||
``` | ||
|
||
# Inspect Docker image metadata | ||
|
||
**Bash** | ||
```bash | ||
$ docker image inspect microsoft/acs-engine:0.8.0 --format "{{json .Config.Labels}}" | jq | ||
{ | ||
"maintainer": "Microsoft", | ||
"org.label-schema.build-date": "2017-10-25T04:35:06Z", | ||
"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.", | ||
"org.label-schema.docker.cmd": "docker run -v ${PWD}:/acs-engine/workspace -it --rm microsoft/acs-engine:0.8.0", | ||
"org.label-schema.license": "MIT", | ||
"org.label-schema.name": "Azure Container Service Engine (acs-engine)", | ||
"org.label-schema.schema-version": "1.0", | ||
"org.label-schema.url": "https://github.com/Azure/acs-engine", | ||
"org.label-schema.usage": "https://github.com/Azure/acs-engine/blob/master/docs/acsengine.md", | ||
"org.label-schema.vcs-url": "https://github.com/Azure/acs-engine.git", | ||
"org.label-schema.vendor": "Microsoft", | ||
"org.label-schema.version": "0.8.0" | ||
} | ||
``` | ||
|
||
**PowerShell** | ||
```powershell | ||
PS> docker image inspect microsoft/acs-engine:0.8.0 --format "{{json .Config.Labels}}" | ConvertFrom-Json | ConvertTo-Json | ||
{ | ||
"maintainer": "Microsoft", | ||
"org.label-schema.build-date": "2017-10-25T04:35:06Z", | ||
"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.", | ||
"org.label-schema.docker.cmd": "docker run -v ${PWD}:/acs-engine/workspace -it --rm microsoft/acs-engine:0.8.0", | ||
"org.label-schema.license": "MIT", | ||
"org.label-schema.name": "Azure Container Service Engine (acs-engine)", | ||
"org.label-schema.schema-version": "1.0", | ||
"org.label-schema.url": "https://github.com/Azure/acs-engine", | ||
"org.label-schema.usage": "https://github.com/Azure/acs-engine/blob/master/docs/acsengine.md", | ||
"org.label-schema.vcs-url": "https://github.com/Azure/acs-engine.git", | ||
"org.label-schema.vendor": "Microsoft", | ||
"org.label-schema.version": "0.8.0" | ||
} | ||
``` | ||
|
||
# Run Docker image | ||
|
||
``` | ||
$ docker run -v ${PWD}:/acs-engine/workspace -it --rm microsoft/acs-engine:0.8.0 | ||
``` |