Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
53c39d78
Commit
53c39d78
authored
Nov 12, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17075 from jeffvance/k8bps-fedora
Auto commit by PR queue bot
parents
87343f32
5ccf0739
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
41 deletions
+22
-41
docker-machine-dev.sh
examples/k8petstore/docker-machine-dev.sh
+19
-15
Dockerfile
examples/k8petstore/redis-master/Dockerfile
+1
-1
Dockerfile
examples/k8petstore/redis-slave/Dockerfile
+1
-1
Dockerfile
examples/k8petstore/redis/Dockerfile
+1
-24
No files found.
examples/k8petstore/docker-machine-dev.sh
View file @
53c39d78
...
@@ -14,17 +14,22 @@
...
@@ -14,17 +14,22 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
!
/bin/bash
#!/bin/bash
source
../../hack/lib/util.sh
# need kube::util::host_platform()
HOST_OS
=
$(
kube::util::host_platform
)
HOST_OS
=
${
HOST_OS
%/*
}
# just host_os name
function
setup_vm
()
{
function
setup_vm
()
{
### Provider = vbox. You can use another one if you want... But untested.
### Provider = vbox. You can use another one if you want... But untested.
PROVIDER
=
virtualbox
PROVIDER
=
virtualbox
### Create a VM specific to this app...
### Create a VM specific to this app...
if
docker-machine
ls
|grep
-q
k8petstore
;
then
if
docker-machine
ls
|
grep
-q
k8petstore
;
then
echo
"VM already exists, moving on..."
echo
"VM already exists, moving on..."
else
else
docker-machine create
--driver
$PROVIDER
k8petstore
docker-machine create
--driver
$PROVIDER
k8petstore
fi
fi
}
}
...
@@ -34,27 +39,24 @@ function setup_docker() {
...
@@ -34,27 +39,24 @@ function setup_docker() {
eval
"
$(
docker-machine
env
k8petstore
)
"
eval
"
$(
docker-machine
env
k8petstore
)
"
docker
rm
-f
`
docker ps
-a
-q
`
docker
rm
-f
`
docker ps
-a
-q
`
### Now capture the IP.
MACHINE_IP
=
"
`
docker-machine ip k8petstore
`
"
}
}
function
build_containers
()
{
function
build_containers
()
{
version
=
"
`
date
+
"%m-%d-%Y-%s"
`
"
version
=
"
`
date
+
"%m-%d-%Y-%s"
`
"
pushd
../
redis
pushd
redis
docker build
-t
jayunit100/k8-petstore-redis:
$version
./
docker build
-t
jayunit100/k8-petstore-redis:
$version
./
popd
popd
pushd
../
redis-master
pushd
redis-master
docker build
-t
jayunit100/k8-petstore-redis-master:
$version
./
docker build
-t
jayunit100/k8-petstore-redis-master:
$version
./
popd
popd
pushd
../
redis-slave
pushd
redis-slave
docker build
-t
jayunit100/k8-petstore-redis-slave:
$version
./
docker build
-t
jayunit100/k8-petstore-redis-slave:
$version
./
popd
popd
pushd
../
web-server
pushd
web-server
docker build
-t
jayunit100/k8-petstore-web-server:
$version
./
docker build
-t
jayunit100/k8-petstore-web-server:
$version
./
popd
popd
}
}
...
@@ -68,14 +70,16 @@ function runk8petstore() {
...
@@ -68,14 +70,16 @@ function runk8petstore() {
### TODO, add slaves.
### TODO, add slaves.
echo
"Running k8petstore now..."
echo
"Running k8petstore now..."
docker run
-d
-p
6379:6379 jayunit100/k8-petstore-redis-master:
$version
docker run
-
-name
redis
-
d
-p
6379:6379 jayunit100/k8-petstore-redis-master:
$version
docker run
-
d
-e
REDISMASTER_SERVICE_HOST
=
$MACHINE_IP
-e
REDISMASTER_SERVICE_PORT
=
6379
-p
3000:3000 jayunit100/k8-petstore-web-server:
$version
docker run
-
-link
redis:redis
-d
-e
REDISMASTER_SERVICE_HOST
=
redis
-e
REDISMASTER_SERVICE_PORT
=
6379
-p
3000:3000 jayunit100/k8-petstore-web-server:
$version
}
}
setup_vm
setup_docker
if
[[
"
$HOST_OS
"
!=
linux
]]
;
then
setup_vm
setup_docker
fi
build_containers
build_containers
...
...
examples/k8petstore/redis-master/Dockerfile
View file @
53c39d78
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#
#
# Just a stub.
# Just a stub.
FROM
jayunit100/redis:2.8.19
FROM
redis
ADD
etc_redis_redis.conf /etc/redis/redis.conf
ADD
etc_redis_redis.conf /etc/redis/redis.conf
...
...
examples/k8petstore/redis-slave/Dockerfile
View file @
53c39d78
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#
#
# Just a stub.
# Just a stub.
FROM
jayunit100/redis:2.8.19
FROM
redis
ADD
run.sh /run.sh
ADD
run.sh /run.sh
...
...
examples/k8petstore/redis/Dockerfile
View file @
53c39d78
...
@@ -5,30 +5,7 @@
...
@@ -5,30 +5,7 @@
#
#
# Pull base image.
# Pull base image.
FROM
ubuntu
FROM
redis
# Install Redis.
RUN
\
cd
/tmp
&&
\
# Modify to stay at this version rather then always update.
#################################################################
###################### REDIS INSTALL ############################
wget http://download.redis.io/releases/redis-2.8.19.tar.gz && \
tar xvzf redis-2.8.19.tar.gz && \
cd redis-2.8.19 && \
################################################################
################################################################
make && \
make install && \
cp -f src/redis-sentinel /usr/local/bin && \
mkdir -p /etc/redis && \
cp -f *.conf /etc/redis && \
rm -rf /tmp/redis-stable* && \
sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf && \
sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
# Define mountable directories.
# Define mountable directories.
VOLUME
["/data"]
VOLUME
["/data"]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment