Skip to content

Commit

Permalink
fixup! Some minor docker improvements
Browse files Browse the repository at this point in the history
Signed-off-by: g2flyer <[email protected]>
  • Loading branch information
g2flyer committed Jan 23, 2024
1 parent a55afd5 commit 48829e2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 20 deletions.
7 changes: 4 additions & 3 deletions bin/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function yell () {
}

function die() {
recho "$(basename $0): $*" >&2
recho "$(basename $0): ERROR: $*" >&2
exit 111
}

Expand Down Expand Up @@ -84,11 +84,12 @@ function force_to_ip()
# -----------------------------------------
function check_pdo_env()
{
# note: despite the 'die' below this does _not_ terminate, just prints error!
: "${PDO_SOURCE_ROOT:-$(die Missing environment variable PDO_SOURCE_ROOT)}"
: "${PDO_HOME:-$(die Missing environment variable PDO_HOME)}"
: "${PDO_HOSTNAME:-$(die Missing environment variable PDO_HOSTNAME)}"
: "${PDO_INTERPRETER:-$(die Missing environment variable PDO_INTERPRETER)}"
: "${PDO_LEDGER_KEY_ROOT:-$(die Missing environment variable PDO_LEDGER_KEY_ROOT)}"
: "${PDO_LEDGER_TYPE:-$(die Missing environment variable PDO_LEDGER_TYPE)}"
: "${PDO_LEDGER_URL:-$(die Missing environment variable PDO_LEDGER_URL)}"
: "${PDO_SOURCE_ROOT:-$(die Missing environment variable PDO_SOURCE_ROOT)}"
: "${PDO_LEDGER_KEY_ROOT:-$(die Missing environment variable PDO_LEDGER_KEY_ROOT)}"
}
4 changes: 2 additions & 2 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ TIMESTAMP := $(shell /bin/date "+%Y%m%d%H%M%S")
all : $(addprefix build_,$(IMAGES))

rebuild_% : repository
@ docker build $(DOCKER_ARGS) \
docker build $(DOCKER_ARGS) \
--build-arg REBUILD=$(TIMESTAMP) \
--build-arg PDO_VERSION=$(PDO_VERSION) \
--tag pdo_$*:$(PDO_VERSION) \
--file $(DOCKER_DIR)/pdo_$*.dockerfile .

build_% : repository
@ docker build $(DOCKER_ARGS) \
docker build $(DOCKER_ARGS) \
--build-arg PDO_VERSION=$(PDO_VERSION) \
--tag pdo_$*:$(PDO_VERSION) \
--file $(DOCKER_DIR)/pdo_$*.dockerfile .
Expand Down
4 changes: 0 additions & 4 deletions docker/pdo_ccf.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ RUN /project/pdo/tools/build_ccf.sh
# Network ports for running services
EXPOSE 6600

ARG PDO_HOSTNAME=localhost
ENV PDO_HOSTNAME=${PDO_HOSTNAME}

# Note that the entry point when specified with exec syntax
# can be extended through the docker run interface far more
# easily than if you use the other specification format of
# a single string
Expand Down
3 changes: 0 additions & 3 deletions docker/pdo_client.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ COPY --chown=${UNAME}:${UNAME} tools/*.sh ./
# build it!!!
RUN /project/pdo/tools/build_client.sh

ARG PDO_HOSTNAME=localhost
ENV PDO_HOSTNAME=${PDO_HOSTNAME}

RUN \
echo 'echo "\
NOTE: to setup environment, \"source /project/pdo/tools/start_client.sh\"\n\
Expand Down
2 changes: 0 additions & 2 deletions docker/pdo_services.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ EXPOSE 7001 7002 7003 7004 7005
EXPOSE 7101 7102 7103 7104 7105
EXPOSE 7201 7202 7203 7204 7205

ARG PDO_HOSTNAME=localhost
ENV PDO_HOSTNAME=$PDO_HOSTNAME

# Note that the entry point when specified with exec syntax
# can be extended through the docker run interface far more
Expand Down
6 changes: 3 additions & 3 deletions docker/tools/build_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

source /project/pdo/tools/environment.sh

# these variables should be unused during build
export PDO_HOSTNAME=
export PDO_LEDGER_URL=
# to get build without (ignored) errors
export PDO_HOSTNAME=localhost
export PDO_LEDGER_URL=https://127.0.0.1:6600

make -C ${PDO_SOURCE_ROOT}/build environment
make -C ${PDO_SOURCE_ROOT}/build template
Expand Down
6 changes: 3 additions & 3 deletions docker/tools/build_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# these variables should be unused during build
export PDO_HOSTNAME=
export PDO_LEDGER_URL=
# to get build without (ignored) errors
export PDO_HOSTNAME=localhost
export PDO_LEDGER_URL=https://127.0.0.1:6600

source /opt/intel/sgxsdk/environment
source /project/pdo/tools/environment.sh
Expand Down

0 comments on commit 48829e2

Please sign in to comment.