Skip to content

Commit b631fa0

Browse files
Merge pull request docker-archive#423 from docker/metatoken
Initial checkin of MetaToken service, POC
2 parents e40a20e + 0235f8e commit b631fa0

File tree

16 files changed

+564
-6
lines changed

16 files changed

+564
-6
lines changed

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ moby/
44
# vendored sources -- these are synced by govendor
55
vendor/*/
66

7-
aws/dockerfiles/files/bin/buoy
7+
aws/dockerfiles/files/bin/*
88
aws/dockerfiles/files/elb-controller/container/bin/*
9-
azure/dockerfiles/files/bin/buoy
9+
azure/dockerfiles/files/bin/*
1010
azure/dockerfiles/files/alb-controller/container/bin/*
1111
tools/buoy/bin/buoy
1212
aws/release/tmp
13-
aws/dockerfiles/files/bin/buoy
14-
azure/dockerfiles/files/bin/buoy
1513
azure/release/tmp
1614
tools/buoy/bin/buoy
15+
tools/metaserver/bin/metaserver
1716
*~
1817
*#
1918
.#*

aws/dockerfiles/Dockerfile.meta

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM alpine:3.4
2+
3+
RUN apk add --update ca-certificates && rm -Rf /tmp/* /var/lib/cache/apk/*
4+
5+
# needed in order for go binary to work.
6+
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
7+
8+
ADD files/bin/metaserver /usr/local/bin/
9+
10+
CMD [ "metaserver" ]

aws/dockerfiles/build_and_push_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
NAMESPACE="${NAMESPACE:-docker4x}"
66
VERSION="${VERSION:-latest}"
77

8-
for IMAGE in shell init guide ddc-init cloud
8+
for IMAGE in shell init guide ddc-init cloud meta
99
do
1010
FINAL_IMAGE="${NAMESPACE}/${IMAGE}-aws:${VERSION}"
1111
docker build -t "${FINAL_IMAGE}" -f "Dockerfile.${IMAGE}" .

aws/release/full_aws_release.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ echo "= Build Buoy ="
172172
cd ../../tools/buoy
173173
./build_buoy.sh
174174

175+
echo "= Build Metaserver ="
176+
cd ../metaserver
177+
./build.sh
178+
175179
cd $BASE_DIR
176180
cd ../dockerfiles
177181

aws/release/nightly.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ export VERSION=aws-v$DOCKER_VERSION-$EDITION_VERSION
7878
cd $BUILD_HOME/code/editions/tools/buoy/
7979
./build_buoy.sh
8080

81+
cd $BUILD_HOME/code/editions/tools/metaserver/
82+
./build.sh
83+
8184
cd $BUILD_HOME/code/editions/aws/dockerfiles/
8285

8386
# build images

aws/release/run_ddc_release.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ CURRPATH=`pwd`
113113
cd ../../tools/buoy/
114114
./build_buoy.sh
115115

116+
cd ../metaserver/
117+
./build.sh
118+
116119
echo "=== CURRPATH=$CURRPATH ==="
117120
# back to release dir
118121
cd $CURRPATH

tools/buoy/Dockerfile.buoy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.6.2
1+
FROM golang:1.6.3
22

33
RUN go get github.com/segmentio/analytics-go
44

tools/metaserver/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM golang:1.7
2+
3+
RUN go get github.com/docker/docker/client
4+
RUN go get github.com/aws/aws-sdk-go
5+
RUN go get github.com/docker/docker/api/types
6+
RUN go get github.com/docker/go-connections/tlsconfig
7+
RUN go get github.com/docker/go-connections/sockets
8+
RUN go get github.com/gorilla/mux
9+
10+
ENV USER root
11+
WORKDIR /go/
12+
13+
COPY . ./
14+
RUN mkdir -p bin
15+
16+
CMD ["/compile.sh"]

tools/metaserver/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
default: build
2+
3+
build:
4+
./build.sh

tools/metaserver/build.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
DOCKER_IMAGE_NAME="metaserver"
6+
DOCKER_CONTAINER_NAME="metaserver-build-container"
7+
8+
if [[ $(docker ps -a | grep $DOCKER_CONTAINER_NAME) != "" ]]; then
9+
echo "remove $DOCKER_CONTAINER_NAME"
10+
docker rm -f $DOCKER_CONTAINER_NAME
11+
fi
12+
13+
docker build -t $DOCKER_IMAGE_NAME .
14+
15+
docker run --name $DOCKER_CONTAINER_NAME $DOCKER_IMAGE_NAME ./compile.sh
16+
17+
mkdir -p bin
18+
docker cp $DOCKER_CONTAINER_NAME:/go/bin/metaserver bin/metaserver
19+
20+
mkdir -p ../../aws/dockerfiles/files/bin/ ../../azure/dockerfiles/files/bin/
21+
rm -f ../../aws/dockerfiles/files/bin/metaserver ../../azure/dockerfiles/files/bin/metaserver
22+
cp bin/metaserver ../../aws/dockerfiles/files/bin/metaserver
23+
cp bin/metaserver ../../azure/dockerfiles/files/bin/metaserver
24+
25+
if [[ $(docker ps -a | grep $DOCKER_CONTAINER_NAME) != "" ]]; then
26+
echo "remove $DOCKER_CONTAINER_NAME"
27+
docker rm -f $DOCKER_CONTAINER_NAME
28+
fi

0 commit comments

Comments
 (0)