更新时间:2022-08-27 18:50:51
FROM golang WORKDIR / RUN git clone https://djannot:xxxx@github.com/djannot/s3pics.git WORKDIR /s3pics RUN go build EXPOSE 8080
--no-cache
参数,以确保最新的源代码是从GitHub上克隆的。core@coreos1 /media/share1/Dockerfiles/s3pics $ docker build --no-cache . Sending build context to Docker daemon 2.048 kB Sending build context to Docker daemon Step 0 : FROM golang ---> 1ea210e0e1f6 Step 1 : WORKDIR / ---> Running in f6987b175723 ---> 022aa96f56d0 Removing intermediate container f6987b175723 Step 2 : RUN git clone https://djannot:xxxx@github.com/djannot/s3pics.git ---> Running in 54d6a32e90ba Cloning into 's3pics'... ---> 3369bca87577 Removing intermediate container 54d6a32e90ba Step 3 : WORKDIR /s3pics ---> Running in d875bc08eac9 ---> 73946142ea54 Removing intermediate container d875bc08eac9 Step 4 : RUN go build ---> Running in e0bd59c1f28b ---> baebdd1b633e Removing intermediate container e0bd59c1f28b Step 5 : EXPOSE 8080 ---> Running in 16d3fa9be1c5 ---> 815b7aed2c83 Removing intermediate container 16d3fa9be1c5 Successfully built 815b7aed2c83
core@coreos1 /media/share1/Dockerfiles/s3pics $ docker push 10.64.231.45:5000/s3pics:2.0 The push refers to a repository [10.64.231.45:5000/s3pics] (len: 1) Sending image list Pushing repository 10.64.231.45:5000/s3pics (1 tags) Image 511136ea3c5a already pushed, skipping Image 16386e29a1f4 already pushed, skipping Image 835c4d274060 already pushed, skipping Image 22c23ce0a90c already pushed, skipping Image 3f1e6432f26e already pushed, skipping Image 7982826b1e59 already pushed, skipping Image 1dafbd563f5a already pushed, skipping Image 7a94d87545e8 already pushed, skipping Image e2d60f7b3d07 already pushed, skipping Image 4f23222e2f74 already pushed, skipping Image 258b590ccdee already pushed, skipping Image 986643313a7b already pushed, skipping Image 1ea210e0e1f6 already pushed, skipping 022aa96f56d0: Image successfully pushed 3369bca87577: Image successfully pushed 73946142ea54: Image successfully pushed baebdd1b633e: Image successfully pushed 815b7aed2c83: Image successfully pushed Pushing tag for rev [815b7aed2c83] on {http://10.64.231.45:5000/v1/repositories/s3pics/tags/2.0}
POST http://<Mesos Marathon IP>:8080/v2/apps { "id": "s3pics", "cmd": "cd /s3pics; ./s3pics -AccessKey=denis@ad.forest -SecretKey=xxxx -EndPoint=http://denisnamespace.ns.viprds.ad.forest -Namespace=denisnamespace", "cpus": 0.1, "mem": 64.0, "instances": 1, "container": { "type": "DOCKER", "docker": { "image": "10.64.231.45:5000/s3pics:2.0", "network": "BRIDGE", "portMappings": [ { "containerPort": 8080, "hostPort": 0, "protocol": "tcp" } ] } }, "healthChecks": [ { "protocol": "HTTP", "portIndex": 0, "path": "/", "gracePeriodSeconds": 10, "intervalSeconds": 20, "maxConsecutiveFailures": 3 } ] }
http://coreos1.ad.forest:31000
的Web应用程序。var files = $("#file")[0].files; var reader = new FileReader(); reader.onload = function(event){ var content = event.target.result; try { $.ajax({ url: 'http://bucket1.denisnamespace.ns.viprds.ad.forest:80/pictures/B6C3OuVCIAEfwjm.jpg', data: content, cache: false, processData: false, type: 'PUT', beforeSend: function (request) { request.setRequestHeader('Content-Length','35964'); request.setRequestHeader('Content-Type','binary/octet-stream'); request.setRequestHeader('x-amz-date','Sun, 11 Jan 2015 12:53:12 UTC'); request.setRequestHeader('host','bucket1.denisnamespace.ns.viprds.ad.forest'); request.setRequestHeader('Authorization','AWS denis@ad.forest:iCnahEUOy8/lanI96tQYA3WKQVE='); }, success: function(data, textStatus, request){ $('#alert-success').html("Picture uploaded").show().delay(5000).fadeOut(); }, error: function(data, textStatus, request){ $('#alert-danger').html("Upload failed").show().delay(5000).fadeOut(); } }); } catch (e) { alert(e); } } reader.readAsArrayBuffer(files[0]);